Sunday, January 15, 2012

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

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.