[ILUG] Quicker (Nicer) Script

Con Hennessy con.hennessy at airtel-atn.com
Fri Mar 3 12:20:14 GMT 2000


"Breathnach, Proinnsias (Dublin)" wrote:
> 
> Guys (and Gals),
> 
> Anyone have a simpler method of doing this ...
> (csh)
> 
> if ( $1 == "A" || $1 == "B" || .... ) then
> endif
> 
> ie: checking if $1 is one of a (large) number of strings ...

What about
        case $1 in
                [A-Z]) echo correct!;;
                *) echo wrong!;;
        esac

Con




More information about the ILUG mailing list