How to get the default version of an application in unix

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Let’s say I have two versions of Firefox installed. What is the way to get the default version of firefox printed? I am running the script in python. Is there way to get the output into python?







share|improve this question


























    up vote
    0
    down vote

    favorite












    Let’s say I have two versions of Firefox installed. What is the way to get the default version of firefox printed? I am running the script in python. Is there way to get the output into python?







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Let’s say I have two versions of Firefox installed. What is the way to get the default version of firefox printed? I am running the script in python. Is there way to get the output into python?







      share|improve this question














      Let’s say I have two versions of Firefox installed. What is the way to get the default version of firefox printed? I am running the script in python. Is there way to get the output into python?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 27 '17 at 11:08









      Jeff Schaller

      32.1k849109




      32.1k849109










      asked Nov 27 '17 at 10:59









      Anoop Vk

      31




      31




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          Assuming that the "default version" is whatever is executed when you enter firefox in a terminal:



          version=subprocess.check_output(['firefox','--version'])





          share|improve this answer






















          • This could be improved by indicating that python will run firefox with (some) $PATH, which dictates which Firefox will start.
            – Jeff Schaller
            Nov 27 '17 at 12:08










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407260%2fhow-to-get-the-default-version-of-an-application-in-unix%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          Assuming that the "default version" is whatever is executed when you enter firefox in a terminal:



          version=subprocess.check_output(['firefox','--version'])





          share|improve this answer






















          • This could be improved by indicating that python will run firefox with (some) $PATH, which dictates which Firefox will start.
            – Jeff Schaller
            Nov 27 '17 at 12:08














          up vote
          0
          down vote



          accepted










          Assuming that the "default version" is whatever is executed when you enter firefox in a terminal:



          version=subprocess.check_output(['firefox','--version'])





          share|improve this answer






















          • This could be improved by indicating that python will run firefox with (some) $PATH, which dictates which Firefox will start.
            – Jeff Schaller
            Nov 27 '17 at 12:08












          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          Assuming that the "default version" is whatever is executed when you enter firefox in a terminal:



          version=subprocess.check_output(['firefox','--version'])





          share|improve this answer














          Assuming that the "default version" is whatever is executed when you enter firefox in a terminal:



          version=subprocess.check_output(['firefox','--version'])






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 27 '17 at 12:12

























          answered Nov 27 '17 at 11:43









          xenoid

          1,7151620




          1,7151620











          • This could be improved by indicating that python will run firefox with (some) $PATH, which dictates which Firefox will start.
            – Jeff Schaller
            Nov 27 '17 at 12:08
















          • This could be improved by indicating that python will run firefox with (some) $PATH, which dictates which Firefox will start.
            – Jeff Schaller
            Nov 27 '17 at 12:08















          This could be improved by indicating that python will run firefox with (some) $PATH, which dictates which Firefox will start.
          – Jeff Schaller
          Nov 27 '17 at 12:08




          This could be improved by indicating that python will run firefox with (some) $PATH, which dictates which Firefox will start.
          – Jeff Schaller
          Nov 27 '17 at 12:08

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407260%2fhow-to-get-the-default-version-of-an-application-in-unix%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?