|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Procedural nature of shell scripts
Code:
#!/bin/bash #this is script1 sleep 30 And Code:
#!/bin/bash #this is script 2 /path/to/script1.sh echo im done Running script 2 will give a 30 second pause and then echo Im done to the terminal. What behavior exactly, is responsible for waiting for script one to complete before the echo line is interpreted? Can someone please explain this mechanism? Does the shell wait for an exit status of any given command unless it is executed with a & at the end to send to background? Thanks, I hope I am being clear. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
A bit of reading:
wait -- Wait for Child Process to End |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
That's exactly what it does. The exit status is available in $? afterwards, but usually is used more directly, since you can plug commands directly into an if-statement.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cant understand the File system working nature | nokiak810 | Solaris | 2 | 11-21-2012 07:47 AM |
| Show Your Kids The Beauty Of The Nature | Linux Bot | Cartoons for Geeks | 0 | 05-22-2011 04:45 AM |
| Specification language suitable for procedural programs | tsurko | Programming | 2 | 02-16-2009 04:41 PM |
| Unable to understand associative nature of awk arrays | nervous | UNIX for Dummies Questions & Answers | 3 | 10-07-2006 06:03 AM |
|
|