awk help
Hi
I'd like to split a string and I used awk : Quote:
It doesn't work;... Any help? |
Is this what you want ??
echo "sun,mon,tue" | sed 's/,/\n/g' suniL Quote:
|
echo $string | awk 'BEGIN {FS=","; OFS="\n"}{$1=$1;print $0}'
Inside the awk command, string is an awk variable and not a bash variable. You could have a bash variable evaluated in the command line. But that isn't the same thing as manipulating a bash variable: echo | awk 'BEGIN {string='\"$string\"'}{print "the input: " string}' |
All times are GMT -5. The time now is 02:21 AM. |