I want to delete a specific line of a file in bash.
What I am currently doing is to get the line number and pass it so sed to delete this line:
awk '/qr/{ print NR; exit }' test | sed -i "${1}d" test
The awk part works well, but in this state, the sed part deletes all the content of the file (named test).
However, when I do it without the variable :
sed -i '1d' test
It works fine.
What am I doing wrong ?