![]() |
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 !! |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi All,
What is the meaning for $! in shell? I am trying to understand a script. And it has the following sequence of commands. Code:
local@usr> a=1 local@usr> echo $a 1 local@usr> echo $!a a |
|
||||
|
$! is a special shell variable which gives the process ID of the last background job you ran.
What does this give you: Code:
local@usr> a=1 local@usr> echo $a 1 local@usr> sleep 1 & local@usr> echo $!a |
| Bits Awarded / Charged to scottn for this Post | |||
| Date | User | Comment | Amount |
| 2 Weeks Ago | guruparan18 | Good one. Thanks | 1,000 |
![]() |
| Bookmarks |
| Tags |
| $ options, $!, unix |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|