Tuesday, April 22, 2008

extract the last field in unix shell script

scratch notes on aws exacting the last field!
echo “ABC.123.QIP.ERR” | awk -F. {’print $(NF-0)’}

- dot after F is the field deliminator
- minus zero is the field to extract from backwards of the string

No comments: