Hi,
I have a variable
ARGS=-start,0x7fffffffffffff1f,0x0000000000000000,{RAW}.*
I would like to extract the following string 0x7fffffffffffff1f,0x0000000000000000,{RAW}.* and further place the string in three different variables as follows
ARGS1=0x7fffffffffffff1f
ARGS2=0x0000000000000000
ARGS3={RAW}.*
P.S: I would wish to extract the string specifiying the starting character as '0'.
Regards
Peru
Page 1 of 1
String manipulations in scripting
#2
Posted 08 October 2008 - 01:05 PM
Using comma as a separator:
$ ARGS="-start,0x7fffffffffffff1f,0x0000000000000000,{RAW}.*"
$ ifs="$IFS"; set -f; IFS=,;set -- $ARGS; set +f; IFS="$ifs"
$ ARGS1="$2" ARGS2="$3" ARGS3="$4"
$ printf "%s\n" "$ARGS1" "$ARGS2" "$ARGS3"
0x7fffffffffffff1f
0x0000000000000000
{RAW}.*
Share this topic:
Page 1 of 1

Help











