[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Sequence of execution within a script

Posted on 2011-10-14
Medium Priority
Last Modified: 2012-05-12
I have a script, MyScript, as follows:

echo 'Sub script A completed'
echo 'Sub script B completed'

I'll be executing the script as:
nohup ./MyScript  &

1) Will SubScriptB wait till SubScriptA is completely finished?
2) Is the execution sequential, i.e., line 1 executes then line 2 and so on?
3) Anything you would suggest to make it better?

Question by:soccerplayer
LVL 11

Accepted Solution

maeltar earned 1000 total points
ID: 36972445
Yes the script is sequential, and looking at the flow you have got thats the only way to do it.
LVL 48

Assisted Solution

Tintin earned 1000 total points
ID: 36972463
Unless you run a process in the background, all the steps will be sequential.


Author Comment

ID: 36973262
I am running the main script MyScript in the background. Will the children script be sequential?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 36973265
I meant, will running MyScript in the background affect anything?
LVL 48

Expert Comment

ID: 36974098
Running MyScript in the background won't affect the sequence of the commands inside that script.
LVL 85

Expert Comment

ID: 36976345
3) Anything you would suggest to make it better?
By what measure of goodness?

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question