XST1 wrote:I cant get typeset working for some reason.... heres my script:
Code: Select all
#!/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: Select all
#!/bin/bash
upper () {
echo "$*" | tr [:lower:] [:upper:]
}
for param in "$@"
do
echo "$(upper $param)"
done
Hope this helps,