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;
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
add a comment
|
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
add a comment
|
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
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
command-line bash scripts python gnu
asked Sep 5 at 20:51
user11490829user11490829
132 bronze badges
132 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
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
Normally you would leave out the ::: too.
– Ole Tange
Sep 6 at 5:27
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
Normally you would leave out the ::: too.
– Ole Tange
Sep 6 at 5:27
add a comment
|
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
Normally you would leave out the ::: too.
– Ole Tange
Sep 6 at 5:27
add a comment
|
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
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
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
add a comment
|
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
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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