Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!emory!gatech!rutgers!njin!princeton!idunno.princeton.edu!qpliu From: qpliu@phoenix.princeton.edu (q.p.liu) Newsgroups: comp.unix.shell Subject: Re: How to convert lower case variable into upper case? Message-ID: Date: 24 Jan 91 04:05:59 GMT References: <530@twg.bc.ca> Sender: news@idunno.Princeton.EDU Reply-To: qpliu@phoenix.princeton.edu Organization: Pwinceton Uniwersity Lines: 23 In-reply-to: bill@twg.bc.ca's message of 23 Jan 91 22:00:59 GMT In article <530@twg.bc.ca> bill@twg.bc.ca (bill) writes: >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? If you don't mind lots of processes, real_port=i1`echo $Port | cut -c3- | tr a-z A-Z` or maybe, real_port=`echo $Port | cut -c-2``echo $Port | cut -c3- | tr a-z A-Z`