Hi I have below code in one of my shell script:
if [ $# -eq 0 ]; then fail $USAGE; fi
while getopts hz:r:t:dz: o
do
case "$o" in
h) echo $USAGE ; exit 0;;
r) export REQ_ID="$OPTARG";;
t) TIMESPAN="$OPTARG";;
d) detail="true";;
[?]) fail $USAGE;;
esac
done
echo "MY TEST REQ ID:::::::"$REQ_ID
-r i am passing is "nbsbwwp|0|crpcltgapez/171.189.215.243|2010-01-08 04:14:26.345@2010-01-08 04:14:26.345|XMLCLIENT"
Even tho it is in "", REQ_ID variable contains only "nbsbwwp|0|crpcltgapez/171.189.215.243|2010-01-08" i.e. only till first blank. I want whole string to be passed to REQ_ID from $OPTARG.
This is quite surprising.
Please help !