I just shifted from Windows to Linux (Ubuntu 18.04)...and following a tutorial to learn bash scripting...
I wrote a simple shell script
#!bin/bash
echo "Hello World"
but when I tried to run it using
$ ./test1.sh
it throws an error
bash: ./test1.sh: bin/bash: bad interpreter: No such file or directory
When I am running it using
$ bash test1.sh
it runs fine
I tried searching it and found many answers but all covers errors due to some difference between windows newline ^M
and ubuntu newline...I tried opening it in VIM under binary mode(don't know what it is) but it did'not have any ^M
tag after bin/bash.
Please suggest what I am doing wrong.