How to convert lower case variable into upper case?

bill bill at twg.bc.ca
Thu Jan 24 09:00:59 AEST 1991


I've  got a good one for the gurus.  I have a Bourne script  that
checks  our  modem  lines when there are no modems  available  to
determine who is using which modem and have they been dormant for
any length of time.

I use the /usr/spool/uucp/LCK..ttyi1x lock file (we use Digiboard
and  the ports are ttyi1[a-z,A-Z] to determine which modem  ports
are  in use.  Since the lock file for port P (using modem control
devices)  becomes LCK..ttyi1p (lower case p), my script wants  to
check the access time for /dev/ttyi1p, instead of /dev/ttyi1P.

Is  there any way, when you have something like Port=ttyi1p, that
you  can  map lower case letters in the variable value  to  upper
case?   If it can be done, the next step would be to prevent  the
"i" from getting mapped and only map the last letter (p) to upper
case (P).

My kludge at this stage is:

case $Port in
        i1o)    real_port=i1O;;
        i1p)    real_port=i1P;;
esac

I would love to be able to do something as simple as:

case $Port in
        i1[a-z])        real_port=i1[A-Z];;
esac

but I doubt life would be that kind to me.  Any ideas?
-- 
Bill Irwin    -       The Westrheim Group     -    Vancouver, BC, Canada
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uunet!van-bc!twg!bill     (604) 431-9600 (voice) |     UNIX Systems
bill at twg.bc.ca            (604) 430-4329 (fax)   |     Integration



More information about the Comp.unix.shell mailing list