Sunday, January 15, 2012
9:23 PM

Special Parameters used in Shell Scripts


There are some special parameters used during Shell Script. These are

1. $0 : This holds the name of the script itself. If you want to print the name of the Script then you can use "$0".

$ cat > ex.sh
#!/bin/bash
echo "The name of the script file is $0 "
Output

$ bash ex.sh
The name of the script file is ex.sh
2. $1 , $2: Positional parameters representing command line argument.

$ cat >

0 comments:

Post a Comment