I am trying to execute commands from a shell script with arguments from a file. The arguments are being escaped with single quotes and I am not sure how to resolve it.
args.txt
-o foo.o > log
foo.sh
arg=$(cat args.txt)
echo $arg
set -x
./command $arg
output
$ ./foo.sh
-o foo.o > log
+ ./command -o foo.o '>' log
I want to remove the single quotes while executing the command. echo
shows no single quotes. I am not able to resolve this so far.