Hi
I have the following requirement. i have the following line from a log file
one : two : Three : four : five : six : seven : eight :nine :ten
Now can you pls help what i should do to get only the following output from the above line
two : five : six : seven : Eight
appreciate your help on this
thanks,
Vince
zaxxon
2
awk -F: '{print $2,$5,$6,$7,$8}' OFS=":" infile
two : five : six : seven : eight
udhay
3
Try with awk....( remove ":" if it's not required ).
awk '{print $2,":"$5,":"$6,":"$7,":"$8}' logfile
Udhay
line="one : two : Three : four : five : six : seven : eight :nine :ten"
IFS=' :'
set -f
set -- $line
printf "%s : " $2 $5 $6 $7; echo $8