IBM Support

qsh: 001-0014 Command /mypath/myscript.qsh not found.

Troubleshooting


Problem

The error, "qsh: 001-0014 Command * not found", is usually due to a missing symbolic link.

Symptom

The following error is reported even though the script does exist, has the execute flags on and you can list its contents with a cat command:
qsh: 001-0014 Command /mypath/myscript.qsh not found.

Diagnosing The Problem

For this example, the script is named /mypath/myscript.qsh.

List the first line of the script by using the head command in Qshell:

head -1 /mypath/myscript.qsh

Output that starts with #! is a shell directive instructing the default shell interpreter which shell program to use. For Qshell on IBM i, there is only one shell and that is /usr/bin/sh. It is not uncommon to see a shell directive though which is referring to /bin/sh: #!/bin/sh. This directive works if there is a symbolic link, /bin, which directs to the hard link, /usr/bin. To check that this link exists, run the following command from an IBM i command line:

WRKLNK OBJ('/bin') DETAIL(*EXTENDED) DSPOPT(*ALL)

If you get an object not found error, add the link by using the following command:
ADDLNK OBJ('/usr/bin') NEWLNK('/bin')

If you see that /bin is a symbolic link and you are getting the qsh: 001-0014 error, then take option 12 on the WRKLNK command to see what /bin is linking to. If it is something other than /usr/bin, then you have a decision to make. You can either remove the link (RMVLNK OBJ('/bin')) and then add it back by using the ADDLNK command shown previously to create a symbolic link to /usr/bin.  Or you can modify your script by removing the shell directive or changing it to #!/usr/bin/sh

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
29 June 2021

UID

nas8N1021807