Command line and wildcard


A little script to show that escaping matters.


examples/script/command_line_wild.sh
echo 0: $0
echo 1: $1
if [ "$1" = '*' ]
then
   echo 'star'
fi

$ ./examples/script/command_line_wild.sh 
0: ./examples/script/command_line_wild.sh
1:

$ ./examples/script/command_line_wild.sh *
0: ./examples/script/command_line_wild.sh
1: README

$ ./examples/script/command_line_wild.sh '*'
0: ./examples/script/command_line_wild.sh
1: README build examples intro.xml linux.yml scripts.xml variables.xml
star

$ ./examples/script/command_line_wild.sh "*"
0: ./examples/script/command_line_wild.sh
1: README build examples intro.xml linux.yml scripts.xml variables.xml
star

$ ./examples/script/command_line_wild.sh \*
0: ./examples/script/command_line_wild.sh
1: README build examples intro.xml linux.yml scripts.xml variables.xml
star