I try to pass a string containted between two #
sign to a ksh script :
Will #> ./a.ksh #This is a string#
Will #>
Nothing is prompted, the execpeted output would be :
Will #> ./a.ksh #This is a string#
#This is a string#
Below the a.ksh
script.
a.ksh
echo $1
echo "$1"
echo ${1}
echo "${1}"
I have tried to protect my
$1
variable by any means I knew but I can't get anything starting with#
to be displayed.
Those following don't work :
#> ./a.ksh #Hello
#> ./a.ksh #
But this do :
#> ./a.ksh Hello#
Any shell guru that could explain me why and how to get this to work as excpeted ?
I can escape those string using \#This String#
or "#This String#"
but I wonder why does #
doesn't print by itself.