getopts scripting in RAC service relocation
Hello
I want to run script like ./ser_reloc.sh -n dev-u1 -t pref
How do I recognize second argument -t in the script
Additionally,if I place -t before -n and use script like below:
would I have to change code for this?
Hello,
I am using below code in AIX env to interpret -n option given in argument while executing the script .I want to give another argument -t
I am using below code in AIX env to interpret -n option given in argument while executing the script .I want to give another argument -t
Code:
#!/bin/sh
#set -x
while getopts ":n:" opt; do
case "$opt" in
n)
host=$OPTARG
shift 2
;;
*)
break
;;
esac
done
echo "host = $host "I want to run script like ./ser_reloc.sh -n dev-u1 -t pref
How do I recognize second argument -t in the script
Additionally,if I place -t before -n and use script like below:
Code:
./ser_reloc.sh -t perf -n dev-u1
would I have to change code for this?
0