Hi,
typeset -l sgf # all lowercase letters
typeset -u SGF # all uppercase letters
sgf=$1
SGF=$sgf
these lines used in my scripts . It ran fine in ksh but when we convert this to bash it erroring out.
I like to know what the use of typeset ??
Thanks & Regards
kanagaraj
Which bash version are you using?
Hi,
In bash we can use decare instead of typeset but its options is limited.
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
I used functions , its worked fine
toUpper() { echo $1 | tr "[:lower:]" "[:upper:]" } GENDER=male GENDER=`toUpper $GENDER` echo $GENDER
toLower() { echo $1 | tr "[:upper:]" "[:lower:]" } GENDER=MALE GENDER=`toLower $GENDER` echo $GENDER
Thnks,
kanagaraj
drl
4
Hi.
Two data points: typeset -l and typeset -u seem to work correctly in:
GNU bash 4.0.35
but not in:
GNU bash 3.2.39
cheers, drl