View previous topic :: View next topic |
Author |
Message |
XST1 Apprentice
Joined: 27 Jan 2004 Posts: 163
|
Posted: Mon Jan 31, 2005 10:21 pm Post subject: typeset not working |
|
|
I cant get typeset working for some reason.... heres my script:
Code: |
#!/bin/bash
for parameterList in $*
do
typeset -u parameterList
echo $parameterList
done
|
heres the warning I get:
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
-u should be an argument of typeset (-u is used to turn a string to uppercase and -l should turn a string to lowercase) |
|
Back to top |
|
|
ctt Tux's lil' helper
Joined: 05 Feb 2005 Posts: 136
|
Posted: Sat Feb 05, 2005 1:55 am Post subject: Re: typeset not working |
|
|
XST1 wrote: | I cant get typeset working for some reason.... heres my script:
Code: |
#!/bin/bash
for parameterList in $*
do
typeset -u parameterList
echo $parameterList
done
|
heres the warning I get:
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
-u should be an argument of typeset (-u is used to turn a string to uppercase and -l should turn a string to lowercase) |
You appear to be mistaken (based on the warning bash gave you, and bash(1)). As for an alternative, tr can be used to change case:
Code: | #!/bin/bash
upper () {
echo "$*" | tr [:lower:] [:upper:]
}
for param in "$@"
do
echo "$(upper $param)"
done
|
Hope this helps, _________________ - chris |
|
Back to top |
|
|
|