I am trying to echo a shebang to a file.
vincent@vincent-X751LJ:~$ echo "#!/usr/bin/sh" > file
echo "#/usr/bin/sh" > file
vincent@vincent-X751LJ:~$ cat file
#/usr/bin/sh
The "bang" vanishes (even in my history !). Everything looks like I never typed !
. I have also tried without the double quotes. Same result.
It does not happen if I echo just #!
vincent@vincent-X751LJ:~$ echo "#!" > file
vincent@vincent-X751LJ:~$ cat file
#!
The reason is certainly so simple...
The only reference to a shebang echoing problem is on SO (How to echo a shebang in cmake COMMAND) but the problem is different on my side.
Thanks