I'm using this very simple bash script:
#!/bin/bash
CMD="sed -e 's/test/abz/' <test >test_res"
echo $CMD
$CMD
When I run the script I get this output:
sed -e 's/test/abz/' <test >test_res
sed: -e expression #1, char 1: unknown command: `''
If I run the exact same cmd (sed -e 's/test/abz/' test_res) on the cmd line (not in a bash script) it works just fine.
What am I doing wrong? Any help is much appreciated.