Is there a way to convert the command line argument to uppercase and pass it as a variable within the script being invoked?
Eg. ./deploy_app.csh 1.2.3.4 middleware
should convert middleware to MIDDLEWARE and pass it as a variable inside the script where ever it requires a variable substitution.
I know that I can use echo and awk to get this output but trying to check if there is a way without using that combination
Best Answer
Using bash (4.0+), inside the script:
Using tcsh:
Using zsh:
Using
tr
instead of shell features (though limited to single-byte letters only in sometr
implementations like GNU's):This page summarizes a lot of features of different UNIX shells, including text manipulation: http://hyperpolyglot.org/unix-shells.