Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!van-bc!twg!bill From: bill@twg.bc.ca (Bill Irwin) Newsgroups: comp.unix.shell Subject: Re: How to convert lower case variable into upper case? Message-ID: <553@twg.bc.ca> Date: 26 Jan 91 08:14:58 GMT References: <530@twg.bc.ca> Organization: The Westrheim Group, Vancouver, B.C., Canada Lines: 36 I asked for a way to convert the name of a uucp lock file into its upper case counterpart /dev device name. Since you don't know which modem ports might be in use, those solutions that had a particular letter "wired" in have limited value. I received several mailed responses. The simplest and most easily understandable (by me), provided by Stuart Hood, follows: case $modem in i[1-9][a-z]) real_modem=i`echo $modem | sed 's/i//' | tr '[a-z]' '[A-Z]'` ;; esac -- S I E M E N S Stuart Hood 65-73 Crockhamwell Road, Woodley, Berkshire, UK ------------- Phone: + 44-734-691994 Email: stuart@siesoft.co.uk N I X D O R F The trouble with everyone, is that they generalise too much I decided to tune it a little bit because when another Digiboard is added, the ports names are "ttyi2x". I would like the script to handle all ports regardless of board number. This is clean and elegant. You (Net) have probably saved me hours of reading about sed in the manual, and I may never have stumbled across tr. Now that I know what these utilities can do, the next time I have a similar problem I can research it in the manual. I think the Net is wonderful for these types of things. Thanks to all who responded. -- Bill Irwin - The Westrheim Group - Vancouver, BC, Canada ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ uunet!van-bc!twg!bill (604) 431-9600 (voice) | Your Computer bill@twg.bc.ca (604) 430-4329 (fax) | Systems Partner