5

awk and sorting

view full story
linux-howto

http://www.linuxquestions.org – Hi! I have in bash script the following line: Code: TMP1=`echo $TMPO | awk '{FS=", "} {for (i = 1; i <= NF; i++) print $i}' | sort -z` which sorts words within string, echo $TMP1 shows that everything is OK, but when i try to : Code: Output=`echo $line | awk -F $DELIM  '{OFS=FS; $1="'"$TMPW"'"; $4="'"$TMP1"'" } {print}'` I get: awk: {OFS=FS; $1="word1"; $4="word2, awk:_________________________^ unterminated string (underline put by me for positioning) Whats wro (HowTos)