Linux Programmer Error: /bin/bash: No such file or directory [How to Solve]

As an example, take the following script.

#!/bin/bash

 

conn=’mysql -upitt -p123456 -hhostname –default-character-set=UTF8 database’

 

`$conn -e “select Name from Product1 where Type=’Live'” > a.txt`

`$conn -e “select Name from Product2 where Type=’Live'” >> a.txt`

echo “query end”

echo “start check”

 

`cd /home/user/NameCheck`

`grep ‘@’ a.txt | wc -l > result.txt`

 

Using Notepad++ editor.

1. In the Edit menu bar, select EOL Conversion sidebar and choose UNIX Format

2. In the Encoding menu bar, select Encode in UTF-8 without BOM

This way, you will not get the error /bin/bash: No such file or directory when running under Linux.

Similar Posts: