You are not logged in.
In shell script how getopts can accept more than one string in one variable DES
Here is the part of shell script that accepts variables from the Shell script but the DES variable does not accepts more than one variable., how to do this ??
When i run the script like below
sh Ericsson_4G_nwid_configuration.sh -n orah4g -d "Ericsson 4g Child" -z Europe/Stockholm
it does not accepts "Ericsson 4g Child" in DES Variable and only accepts "Ericsson" to DES variable.
how to make it accept full "Ericsson 4g Child"
========================================
while getopts “hn:r:p:v:d:z:” OPTION
do
case $OPTION in
h)
usage
exit 1
;;
n)
TEST=$OPTARG
;;
z)
ZONE="$OPTARG"
;;
d)
DES="$OPTARG"
;;
v)
VERBOSE=1
;;
?)
usage
exit
;;
esac
done
Offline
Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_Code
Also, see http://mywiki.wooledge.org/Quotes
Offline
Please post the full script (in code tags). I suspect the problem is elswhere. Is getopts actually running as top-level code, or is it in a function that you pass $@ to? If the latter, make sure you quote "$@" when you pass it to the function.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline