![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sleep command | dr46014 | UNIX for Dummies Questions & Answers | 3 | 10-24-2008 10:06 PM |
| how does sleep work internally? | meetbhattu | UNIX for Dummies Questions & Answers | 1 | 10-29-2007 04:12 PM |
| Sleep Command | Glove | Shell Programming and Scripting | 1 | 10-03-2007 05:02 AM |
| sleep command | leewar | UNIX for Dummies Questions & Answers | 3 | 09-11-2007 12:01 AM |
| How can I get a command to sleep < 1 second? | mattd | UNIX for Dummies Questions & Answers | 1 | 08-04-2003 12:35 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
When you log out of a terminal, a HUP signal is sent to the shell, which passes that signal on to all the tasks/jobs you have running in that terminal. The && means "run the second command if the first command succeeded", and exiting with a signal usually means the command did [i]not[i] succeed, so the second command should not run. So the question really is, why does the first command work? That I am unsure about it. It could be a matter of timing -- you log out just as the sleep command exits.
If you are using BASH, there are several caveats to all this. If you want to make sure something finishes even after you log off, you can do: Code:
nohup sh -c "sleep 10; /etc/init.d/networking force-reload" & |
|
|||||
|
You're right otheus,
Actualy, when I run my touch command, if I logout immediatly (using ctrl+D) the windows freezes for 10 seconds before it actually closes. So obviously, it waits until the command complete and thus explains why the command indeed works. Thanks for your idea! |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| networking, sleep |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|