The next SAP on IBM i webcast is scheduled for Sept 29th. The topic is the new IBM i Navigator, a key tool for all IBM i data centers. It is more secure, faster and easier to use than previous versions. Please visit the website at to see the full agenda.

The next SAP on IBM i webcast is scheduled for Sept 29th. The topic is the new IBM i Navigator, a key tool for all IBM i data centers. It is more secure, faster and easier to use than previous versions. Please visit the website at ibm.biz/ibmi-sap-Sept2… to see the full agenda. pic.twitter.com/NgeITsqYaF

– SAP on IBM i (@SAPonIBMi)08:33 – Aug 22, 2022

Shell Script (.sh) Bad Interpreter Error: No such file or directory

Last Updated on 23 August 2022 by Roberto De Pedrini

Trying to run scripts to manage IBM i Web Services (directory / QIBM / ProdData / OS / WebServices / bin) from a Putty SSH session I get an error

./ myscript.sh: / usr / bin / qsh ^ M: bad interpreter: No such file or directory

Doing some research on Google I discover that the problem is due to the “file-format” of the script file.

To solve the problem we can do one of these 3 things:

Launch the same command from a 5250 QSH / STRQSH sessionModify the file-format with VIM (advanced version of the VI editor) in interactive command mode (see https://www.ibm.com/support/pages/how-fix-usrbinkshm-bad-interpreter-when-using-ibm-content-manager )vim myscript.sh: set fileformat = unix: wqModify the file-format with VIM but in command-line mode (see https://stackoverflow.com/questions/21828093/need-to-write-a-script-to-change-file-format-from-dos-to-unix )vim -c “wq ++ ff = unix” myscript.sh

HTH


Roberto De Pedrini
Faq400.com

Verified by MonsterInsights