bash case statement question
Roger Oberholtzer
roger at opq.se
Wed Sep 21 22:59:08 PDT 2011
On Wed, 2011-09-21 at 10:51 -0700, xDog Walker wrote:
> Here is a question about bash: What does the .$1 mean in the following case
> statement (I know $1 means the first argument, but what does the . mean
> here?)
>
> case .$1 in
>
> and later on:
>
> .[aA])
> SAMPLE="blah";;
I suspect it is in case $1 is not set. Then there is still something in
the case statement (e.g., "case . in"). Without this, the case statement
will fail. Another method is to only do the case statement if you first
determine that $1 has been assigned a value.
Since this '.' has been added to the case part. it also has to be in all
the .XXX) parts as well. Any ASCII printable character would work.
Yours sincerely,
Roger Oberholtzer
OPQ Systems / Ramböll RST
Office: Int +46 10-615 60 20
Mobile: Int +46 70-815 1696
roger.oberholtzer at ramboll.se
________________________________________
Ramböll Sverige AB
Krukmakargatan 21
P.O. Box 17009
SE-104 62 Stockholm, Sweden
www.rambollrst.se
More information about the Linux-users
mailing list