help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Case modification


From: Bill Gradwohl
Subject: Re: [Help-bash] Case modification
Date: Fri, 23 Dec 2011 18:02:30 -0600


  for each letter in word; do
   if [[ $letter = $pattern ]]; then
      uppercase it
   fi
 done


Therefore, pattern (can not be / should not be) more than 1 character, unless its within [ ] then each character gets its turn. Reading the man page does not give me that impression. It hints at it, but is nebulous enough to allow other interpretations.

string='hello there'
read -ra array <<< "$string"
echo "${array[*]^?}"


I was up on your bash FAQ site and read thru it all. I found this example there also. Great site.

BTW - noticed you're with the Cleveland Clinic. Been there, sent relatives there. Best facility I know of.

--
Bill Gradwohl


reply via email to

[Prev in Thread] Current Thread [Next in Thread]