I have a shell like (a short example just to make it simple)
#!/bin/sh
cat $1
I want to save as a file by doing something like
echo -e "#!/bin/sh" > test.sh
echo -e "cat $1" >> test.sh
the line contaning "#!/bin/sh" tries to interpret the line instead of writing it into a file and basically does some stange thing by getting older commands and print them to stdout
It is possible to achieve something?
PS: I tried something like "v=(cat << <some_file>); echo $v > test.sh" which works but again I am not able to replace the <some_file> using a string.