I am new to awk. I know that -v means variable so I tried to do it in every variable from shell. But I do not know why I get this error. Can someone help me? Is there something wrong with my code?
awk -v row_no=$row_no -v item=$item -v itemType=$itemType -v quantity=$quantity -v price=$price '{ NR==row_no;
$1=item
$2=itemType
$3=quantity
$4=price
}1' file.txt > tmp.txt && mv tmp.txt file.txt
The error that I got is:
awk: fatal: cannot open file `-v' for reading (No such file or directory)