I have a shell script that's executing a sed command. Upon variable expansion, it quotes the filename.
sed -i "$3d" $filename
becomes
sed -i 1d '~/file'
as shown by the debugging flag -x
.
When ran, this produces
sed: can't read ~/file: No such file or directory
When I try to run the command manually, the same thing happens, unless I remove the quotes.
sed -i 1d ~/file
Running without quotes produces the desired output.
-x
"? My version of sed doesn't appear to have this. – Sparhawk May 04 '19 at 06:26set -x
is not on a form suitable for execution. It's is purely shell tracing output. – Kusalananda May 04 '19 at 07:37