Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

!#/bin/bash: No such file or directory

Tags:

linux

shell

First, I run

/bin/bash a.sh

It succeed.

But when I want to run

/bin/bash a.sh > a_info.txt

It failed.

Error: line 1: !#/bin/bash: No such file or directory

It does not seem that it’s '^M' that’s causing this error.

like image 718
alexqinbj Avatar asked Jun 07 '13 15:06

alexqinbj


1 Answers

The shebang pattern is #!/bin/your_shell, not !#/bin/your_shell. Just fix the typo.

like image 125
viraptor Avatar answered Oct 15 '22 08:10

viraptor