Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$1 usage

Status
Not open for further replies.

unixwhoopie

Programmer
May 6, 2003
45
US
I am not sure how $1 works. If I have something like this in a shell script, what is $1?

if [ -z "$1" ]
then
echo "Not found"
else
DATFILE=${DAT_DIR}/$1
fi

thanks
 
1. if inside the scope of the shell function, $1 means the FIRST argument passed to a function

2. if not inside the of the shell function, $1 refers to the script's FIRST command line argument

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top