Hi everybody:
Hi everybody:
I try to print in new file selected lines from another file wich depends on the first column.
I have done a script like this:
But I have the next error:
/T-eff.sh: 42: Syntax error: "(" unexpected ------ where the line 42 correspond when I declare the array "lines"
Any suggestion?. Thanks in advance.
Hi everybody:
I try to print in new file selected lines from another file wich depends on the first column.
I have done a script like this:
Code:
lines=( "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "21" "31" "41" "51" "55" "57" "58" )
${lines[@]}
for lines in ${lines[@]}
do
awk -v target=$lines ' if(NR == target) {print $0} ' file1 >> file2
done
But I have the next error:
/T-eff.sh: 42: Syntax error: "(" unexpected ------ where the line 42 correspond when I declare the array "lines"
Any suggestion?. Thanks in advance.