Sequence of execution within a script

Posted on 2011-10-14
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

    Yes the script is sequential, and looking at the flow you have got thats the only way to do it.
    LVL 48

    Assisted Solution

    Unless you run a process in the background, all the steps will be sequential.


    Author Comment

    I am running the main script MyScript in the background. Will the children script be sequential?

    Author Comment

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

    Expert Comment

    Running MyScript in the background won't affect the sequence of the commands inside that script.
    LVL 84

    Expert Comment

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

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    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…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now