![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| please explain the below | mail2sant | Shell Programming and Scripting | 1 | 04-04-2008 08:04 AM |
| please explain this | dummy_needhelp | Shell Programming and Scripting | 2 | 10-15-2007 01:17 AM |
| Can anyone explain plz | r_W213 | UNIX for Advanced & Expert Users | 3 | 03-27-2007 04:52 AM |
| if [ $? -eq 0 ] .. can someone explain this? | ranjita.c | Shell Programming and Scripting | 5 | 10-03-2006 07:50 PM |
| Explain awk | hitmansilentass | Shell Programming and Scripting | 4 | 09-27-2006 02:14 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
PGM=${0##/}
TMP=/tmp/${PGM}.$$ $0 is the complete-name-of-the-script in side the script (e.g. /home/mydir/myscript.sh) So, ${0##/} means the complete-name-of-the-script without the starting-slash (if it exists)!! But, what I thing you wanted to write is: PGM=${0##*/} which means complete-name-of-the-script without everthing up to and including the last-slash (e.g. myscript.sh) Then, $$ is the Process-ID of the current script. So, TMP will be set to be /tmp/myscript.sh.1234 (where 1234 is the process-id). This combination is normally used to create unique (i.e. different for each running script) names. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|