bash case statement question

David A. Bandel david.bandel at gmail.com
Thu Sep 22 14:55:21 PDT 2011


On Thu, Sep 22, 2011 at 00:59, Roger Oberholtzer <roger at opq.se> wrote:
> 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.

actually, *) would take care of the case where $1 isnull, but he need
".*" to account for the dot.

>
> 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
>
>
> _______________________________________________
> Linux-users mailing list ( Linux-users at linux-sxs.org )
> Unsub/Password/Etc:
> http://linux-sxs.org/mailman/listinfo/linux-users
>
> Need to chat further on this subject? Check out #linux-users on irc.linux-sxs.org !
>
Ciao,

David A. Bandel
-- 
Two things are infinite: the universe and human stupidity; and I'm not
sure about the the universe. -- Albert Einstein
Visit my web page at: http://david.bandel.us/




More information about the Linux-users mailing list