How do I run the same exact command, N number of times in parallel using GNU parallel?Anomalous result using bash “set” commandHow can I decode a base64 string from the command line?Can I run command-line commands within a python script?Bash script that runs a command with arguments and redirectsCreate a custom sudo command without passwordShould I execute bash scripts from python with `bash` or `./`?Set Mouse Cursor to Left Center of Currently Active Display With Command/ScriptWhat does “exec 1>/var/opt/log/my_logs/MYPROG_`date '+%Y%m%d_%H%M%S'`.log 2>&1” do?argument not recognized for-loop

Locked folder with obscure app from Sourceforge, now cannot unlock folder

Why does rapeseed oil turn sticky but coconut oil doesn't?

Does "solicit" mean the solicitor must receive what is being solicited in context of 52 U.S. Code Section 30121?

Can it be viewed as a negative for PhD applications in the US if I have children?

How to deal with lack of advantages for a character starting at low point total?

How to break a equation with a single "summation symbol (sum) " common?

How can one "treat writing as a job" even though it doesn't pay?

Does toddler keep hands around private parts?

What is the name of the fallacy involving white and black swans?

How to play proper time when other instrument is playing out of time?

Bash script that shows changing real time values from commands

Ethics: Is it ethical for a professor to conduct research using a student's ideas without giving them credit?

Could life arise using iron pentacarbonyl as a solvant?

Is the genre 'fantasy' still fantasy without magic?

Sort and Table a Sentence by Word Lengths

Do repulsorlifts work upside-down?

Principle of stationary action vs Euler-Lagrange Equation

Should I tell an editor that I believe an article I'm reviewing is not good enough for the journal?

Why are rain clouds darker?

Using characters to delimit commands (like markdown)

Isn't any conversation with the US president quid-pro-quo?

Why is the core ChaCha primitive not good for use in a CRCF? Why create BLAKE?

how can traditional forms of magic compete against demon magic?

Is there a heavy usage of the word "bonfire" in English?



How do I run the same exact command, N number of times in parallel using GNU parallel?


Anomalous result using bash “set” commandHow can I decode a base64 string from the command line?Can I run command-line commands within a python script?Bash script that runs a command with arguments and redirectsCreate a custom sudo command without passwordShould I execute bash scripts from python with `bash` or `./`?Set Mouse Cursor to Left Center of Currently Active Display With Command/ScriptWhat does “exec 1>/var/opt/log/my_logs/MYPROG_`date '+%Y%m%d_%H%M%S'`.log 2>&1” do?argument not recognized for-loop






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









1


















I want to execute a python script X times with the same arguments in parallel, but I don't know how to accomplish this with GNU parallel.



Essentially what I'm trying to do is the equivalent of




parallel 'python3 script.py' ::: file1 file1 file1 ... file1




without having to manually type the filename X times










share|improve this question































    1


















    I want to execute a python script X times with the same arguments in parallel, but I don't know how to accomplish this with GNU parallel.



    Essentially what I'm trying to do is the equivalent of




    parallel 'python3 script.py' ::: file1 file1 file1 ... file1




    without having to manually type the filename X times










    share|improve this question



























      1













      1









      1








      I want to execute a python script X times with the same arguments in parallel, but I don't know how to accomplish this with GNU parallel.



      Essentially what I'm trying to do is the equivalent of




      parallel 'python3 script.py' ::: file1 file1 file1 ... file1




      without having to manually type the filename X times










      share|improve this question














      I want to execute a python script X times with the same arguments in parallel, but I don't know how to accomplish this with GNU parallel.



      Essentially what I'm trying to do is the equivalent of




      parallel 'python3 script.py' ::: file1 file1 file1 ... file1




      without having to manually type the filename X times







      command-line bash scripts python gnu






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 5 at 20:51









      user11490829user11490829

      132 bronze badges




      132 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          1



















          I'm not sure it's the right way to do it, but you could generate N dummy arguments (using seq for example) and then tell parallel to read but not insert them using -N0 (making the real argument part of the command string).



          Ex. for N = 5:



          $ seq 1 5 | parallel --dryrun -N0 python3 script.py file1 :::
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1





          share|improve this answer


























          • Normally you would leave out the ::: too.

            – Ole Tange
            Sep 6 at 5:27












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1171165%2fhow-do-i-run-the-same-exact-command-n-number-of-times-in-parallel-using-gnu-par%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1



















          I'm not sure it's the right way to do it, but you could generate N dummy arguments (using seq for example) and then tell parallel to read but not insert them using -N0 (making the real argument part of the command string).



          Ex. for N = 5:



          $ seq 1 5 | parallel --dryrun -N0 python3 script.py file1 :::
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1





          share|improve this answer


























          • Normally you would leave out the ::: too.

            – Ole Tange
            Sep 6 at 5:27















          1



















          I'm not sure it's the right way to do it, but you could generate N dummy arguments (using seq for example) and then tell parallel to read but not insert them using -N0 (making the real argument part of the command string).



          Ex. for N = 5:



          $ seq 1 5 | parallel --dryrun -N0 python3 script.py file1 :::
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1





          share|improve this answer


























          • Normally you would leave out the ::: too.

            – Ole Tange
            Sep 6 at 5:27













          1















          1











          1









          I'm not sure it's the right way to do it, but you could generate N dummy arguments (using seq for example) and then tell parallel to read but not insert them using -N0 (making the real argument part of the command string).



          Ex. for N = 5:



          $ seq 1 5 | parallel --dryrun -N0 python3 script.py file1 :::
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1





          share|improve this answer














          I'm not sure it's the right way to do it, but you could generate N dummy arguments (using seq for example) and then tell parallel to read but not insert them using -N0 (making the real argument part of the command string).



          Ex. for N = 5:



          $ seq 1 5 | parallel --dryrun -N0 python3 script.py file1 :::
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1
          python3 script.py file1






          share|improve this answer













          share|improve this answer




          share|improve this answer










          answered Sep 5 at 22:36









          steeldriversteeldriver

          81.8k12 gold badges133 silver badges222 bronze badges




          81.8k12 gold badges133 silver badges222 bronze badges















          • Normally you would leave out the ::: too.

            – Ole Tange
            Sep 6 at 5:27

















          • Normally you would leave out the ::: too.

            – Ole Tange
            Sep 6 at 5:27
















          Normally you would leave out the ::: too.

          – Ole Tange
          Sep 6 at 5:27





          Normally you would leave out the ::: too.

          – Ole Tange
          Sep 6 at 5:27


















          draft saved

          draft discarded















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1171165%2fhow-do-i-run-the-same-exact-command-n-number-of-times-in-parallel-using-gnu-par%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

          How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

          Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü