While using the "Run Command Line" action it is ending with:
Return value: 127
Std out:
Std err: /bin/sh: <command>: No such file or directory.
Command line executed: /bin/sh -c "<command + arguments>"
Release Automation Agent on Linux
The problem is that the <command> and <arguments> were entirely surrounded by quotes which instructs the shell to look for a command that is named the same name as the <command> and <arguments>. Example:
In the "Command Line String [String]" field the following value was supplied: "cat /tmp/helloworld.txt"
This may stem from confusion by seeing that /bin/sh -c is used before the command. But /bin/sh -c is used in the background. To find the appropriate command line string you need to find the appropriate syntax to use by using the <command> and <arguments> at the linux command prompt - NOT /bin/sh -c <command> <arguments>.
If you tried to execute the following at the linux command prompt it would fail with the same exact error messages and return code (which you can find by running "echo $?" immediately after the command): "cat /tmp/helloworld.txt"
But if you execute the following it would work (provided you have a /tmp/helloworld.txt file) and therefore should be the command that you specify in the "Command Line String [String]" field of the action: cat /tmp/helloworld.txt
You may have scenarios that require quotation marks in the command. For example, when a file/path contains spaces or when a grep search string has spaces. In these cases you still just provide the "Command Line String [String]" field of the action the same value that you would use at the linux command prompt. Example:
To cat a file that has a space in its filename: cat "/tmp/hello world.txt"
Notice how the quotation marks surround the path/filename - not the entire cat command & arguments.
Identify the appropriate command to use from the linux command prompt and use that command in the "Command Line String [String]" field of the Run Command Line action. Make sure to not use /bin/sh -c when trying to identify the appropriate command to run from the Linux command prompt.
None