How can I write a script to create a queue to submit jobs for terminalHow to create a script to launch several emulated ROM inside a folderHow can I send commands to specific terminal windows?Problems with variables on shellrc.local command have user prompt and not run at startupA clever script for logging program runCreate an installer/package for a scriptCombining several youtube-dl commands into one scriptAwk programming: Split large file into smaller ones based on patternBash script to run python script for all images in all subdirectoriesAutomating a daily displacement of files bearing dates in their names

Is Social Media Science Fiction?

Email Account under attack (really) - anything I can do?

Why don't electron-positron collisions release infinite energy?

Why is an old chain unsafe?

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

Extreme, but not acceptable situation and I can't start the work tomorrow morning

Circuitry of TV splitters

Are white and non-white police officers equally likely to kill black suspects?

What are these boxed doors outside store fronts in New York?

Why CLRS example on residual networks does not follows its formula?

Banach space and Hilbert space topology

What is the offset in a seaplane's hull?

I probably found a bug with the sudo apt install function

Is there really no realistic way for a skeleton monster to move around without magic?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

How to type dʒ symbol (IPA) on Mac?

What do you call a Matrix-like slowdown and camera movement effect?

If Manufacturer spice model and Datasheet give different values which should I use?

Japan - Plan around max visa duration

least quadratic residue under GRH: an EXPLICIT bound

LED on same Pin as Toggle Switch, not illuminating

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

Is there a familial term for apples and pears?



How can I write a script to create a queue to submit jobs for terminal


How to create a script to launch several emulated ROM inside a folderHow can I send commands to specific terminal windows?Problems with variables on shellrc.local command have user prompt and not run at startupA clever script for logging program runCreate an installer/package for a scriptCombining several youtube-dl commands into one scriptAwk programming: Split large file into smaller ones based on patternBash script to run python script for all images in all subdirectoriesAutomating a daily displacement of files bearing dates in their names






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








1















I have several input files for a program installed in my ubuntu, I can do it manually and put



keyword teste.in


But since I have a really large number of files all with different names I would like to make this automatic. Is it possible to create a queue here the script submits the first job and when this is finished it submits the following one and then all the others one at a time?



Thanks










share|improve this question






















  • Can you describe in more detail what it is you want to do, with a more complete example?

    – Elias
    2 days ago






  • 1





    I'm using a program called QE that is a modelling code that reads a quite complex input file name.in So, I've several ZZYX.in XXY2.in YZX3.in .... and I need to run all of them after each other. Usual to run I need to write in the command line ~qe name.in but now I would like to make a queue like a script that submits one after each other with qe inputname.in

    – user9251343
    2 days ago


















1















I have several input files for a program installed in my ubuntu, I can do it manually and put



keyword teste.in


But since I have a really large number of files all with different names I would like to make this automatic. Is it possible to create a queue here the script submits the first job and when this is finished it submits the following one and then all the others one at a time?



Thanks










share|improve this question






















  • Can you describe in more detail what it is you want to do, with a more complete example?

    – Elias
    2 days ago






  • 1





    I'm using a program called QE that is a modelling code that reads a quite complex input file name.in So, I've several ZZYX.in XXY2.in YZX3.in .... and I need to run all of them after each other. Usual to run I need to write in the command line ~qe name.in but now I would like to make a queue like a script that submits one after each other with qe inputname.in

    – user9251343
    2 days ago














1












1








1








I have several input files for a program installed in my ubuntu, I can do it manually and put



keyword teste.in


But since I have a really large number of files all with different names I would like to make this automatic. Is it possible to create a queue here the script submits the first job and when this is finished it submits the following one and then all the others one at a time?



Thanks










share|improve this question














I have several input files for a program installed in my ubuntu, I can do it manually and put



keyword teste.in


But since I have a really large number of files all with different names I would like to make this automatic. Is it possible to create a queue here the script submits the first job and when this is finished it submits the following one and then all the others one at a time?



Thanks







command-line bash scripts batch






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 days ago









user9251343user9251343

83




83












  • Can you describe in more detail what it is you want to do, with a more complete example?

    – Elias
    2 days ago






  • 1





    I'm using a program called QE that is a modelling code that reads a quite complex input file name.in So, I've several ZZYX.in XXY2.in YZX3.in .... and I need to run all of them after each other. Usual to run I need to write in the command line ~qe name.in but now I would like to make a queue like a script that submits one after each other with qe inputname.in

    – user9251343
    2 days ago


















  • Can you describe in more detail what it is you want to do, with a more complete example?

    – Elias
    2 days ago






  • 1





    I'm using a program called QE that is a modelling code that reads a quite complex input file name.in So, I've several ZZYX.in XXY2.in YZX3.in .... and I need to run all of them after each other. Usual to run I need to write in the command line ~qe name.in but now I would like to make a queue like a script that submits one after each other with qe inputname.in

    – user9251343
    2 days ago

















Can you describe in more detail what it is you want to do, with a more complete example?

– Elias
2 days ago





Can you describe in more detail what it is you want to do, with a more complete example?

– Elias
2 days ago




1




1





I'm using a program called QE that is a modelling code that reads a quite complex input file name.in So, I've several ZZYX.in XXY2.in YZX3.in .... and I need to run all of them after each other. Usual to run I need to write in the command line ~qe name.in but now I would like to make a queue like a script that submits one after each other with qe inputname.in

– user9251343
2 days ago






I'm using a program called QE that is a modelling code that reads a quite complex input file name.in So, I've several ZZYX.in XXY2.in YZX3.in .... and I need to run all of them after each other. Usual to run I need to write in the command line ~qe name.in but now I would like to make a queue like a script that submits one after each other with qe inputname.in

– user9251343
2 days ago











1 Answer
1






active

oldest

votes


















0














You can do something like the following. Suppose I have several files in a directory, in my little test case I have three files called a.txt b.txt c.txt. Then in bash I can use a for loop like this:



for name in `ls` ; do echo now name is $name ; cat $name ; done


The variable $name will contain the current filename, and it will loop through all the filenames listed by the ls command. Of course, instead of the "cat $name" that I used for my test, you would use your own command, like "qe $name" or whatever.



If you don't like separating things with semicolons as above, you can instead write it on separate lines in a script file, like this:



for name in `ls` ; do
echo now name is $name
cat $name
done


The "echo now name is $name" part is not necessary, it is just something I like to have to see what the script is doing.






share|improve this answer


















  • 1





    This is great thanks

    – user9251343
    2 days ago











  • @user9251343 Great, set it as "accepted" answer then :-)

    – Elias
    2 days ago











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/3.0/"u003ecc by-sa 3.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%2f1131471%2fhow-can-i-write-a-script-to-create-a-queue-to-submit-jobs-for-terminal%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









0














You can do something like the following. Suppose I have several files in a directory, in my little test case I have three files called a.txt b.txt c.txt. Then in bash I can use a for loop like this:



for name in `ls` ; do echo now name is $name ; cat $name ; done


The variable $name will contain the current filename, and it will loop through all the filenames listed by the ls command. Of course, instead of the "cat $name" that I used for my test, you would use your own command, like "qe $name" or whatever.



If you don't like separating things with semicolons as above, you can instead write it on separate lines in a script file, like this:



for name in `ls` ; do
echo now name is $name
cat $name
done


The "echo now name is $name" part is not necessary, it is just something I like to have to see what the script is doing.






share|improve this answer


















  • 1





    This is great thanks

    – user9251343
    2 days ago











  • @user9251343 Great, set it as "accepted" answer then :-)

    – Elias
    2 days ago















0














You can do something like the following. Suppose I have several files in a directory, in my little test case I have three files called a.txt b.txt c.txt. Then in bash I can use a for loop like this:



for name in `ls` ; do echo now name is $name ; cat $name ; done


The variable $name will contain the current filename, and it will loop through all the filenames listed by the ls command. Of course, instead of the "cat $name" that I used for my test, you would use your own command, like "qe $name" or whatever.



If you don't like separating things with semicolons as above, you can instead write it on separate lines in a script file, like this:



for name in `ls` ; do
echo now name is $name
cat $name
done


The "echo now name is $name" part is not necessary, it is just something I like to have to see what the script is doing.






share|improve this answer


















  • 1





    This is great thanks

    – user9251343
    2 days ago











  • @user9251343 Great, set it as "accepted" answer then :-)

    – Elias
    2 days ago













0












0








0







You can do something like the following. Suppose I have several files in a directory, in my little test case I have three files called a.txt b.txt c.txt. Then in bash I can use a for loop like this:



for name in `ls` ; do echo now name is $name ; cat $name ; done


The variable $name will contain the current filename, and it will loop through all the filenames listed by the ls command. Of course, instead of the "cat $name" that I used for my test, you would use your own command, like "qe $name" or whatever.



If you don't like separating things with semicolons as above, you can instead write it on separate lines in a script file, like this:



for name in `ls` ; do
echo now name is $name
cat $name
done


The "echo now name is $name" part is not necessary, it is just something I like to have to see what the script is doing.






share|improve this answer













You can do something like the following. Suppose I have several files in a directory, in my little test case I have three files called a.txt b.txt c.txt. Then in bash I can use a for loop like this:



for name in `ls` ; do echo now name is $name ; cat $name ; done


The variable $name will contain the current filename, and it will loop through all the filenames listed by the ls command. Of course, instead of the "cat $name" that I used for my test, you would use your own command, like "qe $name" or whatever.



If you don't like separating things with semicolons as above, you can instead write it on separate lines in a script file, like this:



for name in `ls` ; do
echo now name is $name
cat $name
done


The "echo now name is $name" part is not necessary, it is just something I like to have to see what the script is doing.







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









EliasElias

1067




1067







  • 1





    This is great thanks

    – user9251343
    2 days ago











  • @user9251343 Great, set it as "accepted" answer then :-)

    – Elias
    2 days ago












  • 1





    This is great thanks

    – user9251343
    2 days ago











  • @user9251343 Great, set it as "accepted" answer then :-)

    – Elias
    2 days ago







1




1





This is great thanks

– user9251343
2 days ago





This is great thanks

– user9251343
2 days ago













@user9251343 Great, set it as "accepted" answer then :-)

– Elias
2 days ago





@user9251343 Great, set it as "accepted" answer then :-)

– Elias
2 days ago

















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%2f1131471%2fhow-can-i-write-a-script-to-create-a-queue-to-submit-jobs-for-terminal%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

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?