Friday, 22 April 2011

Default parameter values in Bash





$ cat test.sh
#!/bin/bash 
ARG1=${1-parameter_1_not_set}
echo $ARG1

$ ./test.sh 
parameter_1_not_set

$ ./test.sh rrrr
rrrr


References
http://tldp.org/LDP/abs/html/parameter-substitution.html


No comments:

Post a Comment