Saturday, July 23, 2005

Positional parameters

myscript.sh:


#!/bin/sh
echo $0 $1 $2 $3


$ ./myscript.sh Running Ubuntu Hoary
./myscript.sh Running Ubuntu Hoary


$* contains all the positional args


$# contains the number of arguments passed

0 Comments:

Post a Comment

<< Home