Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!att!pacbell.com!ucsd!swrinde!zaphod.mps.ohio-state.edu!van-bc!twg!bill From: bill@twg.bc.ca (bill) Newsgroups: comp.unix.shell Subject: How to convert lower case variable into upper case? Message-ID: <530@twg.bc.ca> Date: 23 Jan 91 22:00:59 GMT Organization: The Westrheim Group, Vancouver, B.C., Canada Lines: 36 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@twg.bc.ca (604) 430-4329 (fax) | Integration