Off topic:awk command in shell script
1
1
Entering edit mode
6.5 years ago
mittu1602 ▴ 200

I have an awk command which runs well on terminal: this awk command creates diffrent file according to their column header. awk command:

for((i=2;i<5;i++)); do awk -v i=$i 'BEGIN{OFS=FS="\t"}NR==1{n=$i}{print $1,$i > n".txt"}' ${Batch}.result.txt; done

the same command when incorporated in a shell script shows error:

Syntax error: Bad for loop variable
awk shell linux • 2.3k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2662 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6