It's all about the answers!

Ask a question

using Command Line Adapter cannot run shell scripts


Chandrahasa Reddy D (4714460) | asked Jun 13 '12, 5:31 a.m.

Hi,

I have installed RQM 4.0 on linux environment and I am accessing RQM web on my window box. Whatever the shell script I write and execute from RQM it says " Command not found ". How to resolve this error.?

One answer



permanent link
Pramod Chandoria (2.1k11120) | answered Jun 13 '12, 6:59 a.m.
JAZZ DEVELOPER
Hi Chandra,
Where your command line adapter is running? What is the command you are running, make sure the command specified is valid on the machine where adapter is running.
I am assuming " Command not found " is showing in Execution Result.

Comments
Chandrahasa Reddy D commented Jun 13 '12, 7:06 a.m. | edited Jun 13 '12, 7:15 a.m.

Hi Pramod, I am trying to run the following shell script:

!/bin/bash

cd /dir for i in ls do echo $i; done And the CLA is running is Linux box where I am invoking this script. Yes in execution results it says "ls : command not not found" this message attached stdout. Any suggestions ?


Pramod Chandoria commented Jun 13 '12, 9:11 a.m.
JAZZ DEVELOPER

How your command line remote script looks in RQM? Is it ference to a shell script file or the command directly is given in remote script in RQM. Try with creating a file and in remote script just specify the name of the file and see if that works.


Chandrahasa Reddy D commented Jun 14 '12, 4:37 a.m.

Hello Pramod, I have given the name of the .sh file..Inside this .sh file I am running 'ls' command.. and in the Command line I have given path of the .sh file where it is created !.. any more suggestions?


Thomas Neal commented Jun 14 '12, 10:10 a.m.
JAZZ DEVELOPER

Hello Chandra, When logged in as the user who started the command line adapter, can you run your .sh script successfully? ie. outside of RQM.

You might also try adding the line 'set -x' to the top of your .sh script and then run it again under RQM. This will send a list of the commands executed to the stderr stream.

Another thing to check is whether you're able to successfully run some basic linux command like 'who' or 'date'. Create a RQM command line test script where the command to run is /usr/bin/who or /bin/date and see if that runs successfully.


Chandrahasa Reddy D commented Jun 18 '12, 5:11 a.m.

Thanks Neal.. I am able to run the sample command which you mentioned "who".. If I just mention "who" it does not work but with "/usr/bin/who" it works. So does it mean that, we need to follow this convention for running all other scripts?


Chandrahasa Reddy D commented Jun 26 '12, 2:27 a.m.

Hi Thomos, I am executing following python script:

! /usr/local python

currency = u"€" print ord(currency)

I get error and the message in std.err is: Cannot run program "/Scripts/myscript.py": error=13, Permission denied any siggestions?

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.