hello everybody. i am attempting to use a script which returns the error:
bash: ./script.sh: /bin/bsh^M: bad interpreter: No such file or directory
upon "chmod"ing and executing. the code is:


grep 'Time :   '    rob_onholiday298.gout | awk '{print $4}'  > temp1

grep 'Total energy ' rob_onholiday298.gout | awk '{print $5}'  > temp2

grep 'Temperature '     rob_onholiday298.gout | awk '{print $5}'  > temp3

paste temp1 temp2          >> Energy-time3.txt

paste temp1 temp3           >> Temperature-time3.txt

rm temp1 temp2 temp3

the error message seems tro suggest that the shebang is wrong, but i have tried several iterations (usr/bin/bsh etc.) and its not happy. incidentally, inputting the lines one by one does what i expect
hopefully you can help

6 Years
Discussion Span
Last Post by griswolf

From the command line chant which bsh and see what happens. My guess: It will print nothing (which means it can't find bsh on your $PATH). Could you be having a bad editorial day and missing the 'a' in bash? (a few minutes later): OK, I see that on some systems the sh interpreter is spelled bsh so that might be the problem: Try changing your shbang to the result of chanting which sh or which bash Either should work for this simple script.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.