Yes you want the double quotes What you are doing is passing into ksh a command line. The ; in the command line causes the korn shell to break it into multiple lines to execute. Without the double quotes ksh thinks you have a command and parameters for that command.
The main thing is having the correct cd to get to the script file. For that I telnet/cygWin/PuTTY/... into the box, get to the directory where the file is, and run the pwd command to get the full path (with all leading/trailing slashes needed). Fred -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of Nall, Roger Sent: Wednesday, October 23, 2013 3:30 PM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script ** I have attached a screenshot that shows the directory structure. Home and nfs(abc) are clearly separate directories. My last attempt was ksh cd abc/def/ghi/./shellscript.ksh which if I understood you correctly is what you suggested. I see that you have double quotes around part of that statement. I was not sure if I need those so I left them off. This still did not work. Do I need to include the quotes? Thanks, Roger A Nall Sr. Remedy Developer 7668 Warren Parkway Frisco, TX 75034 Desk: 972-464-3162 Cell: 973-652-6723 -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of Grooms, Frederick W Sent: Wednesday, October 23, 2013 2:34 PM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script It sounds like the real path for shellscript.ksh is /home/aradmin/abc/def/ghi/shellscript.ksh As long as the first line has the correct location for the ksh shell in your environment (Use "which ksh" to find it) you should be able to just call /home/aradmin/abc/def/ghi/shellscript.ksh from your escalation I believe another way would be to ksh "cd abc/def/ghi; ./shellscript.ksh" Fred -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of Nall, Roger Sent: Wednesday, October 23, 2013 2:25 PM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script So we are making some progress. The default path for all Remedy related processes is home/aradmin. We created another script that has this: cd abc/def/ghi ksh shellscript.ksh Then in the escalation I have /home/aradmin/./newshellscript.sh This works fine but it not really what we want to do. The location of shellscript.ksh is on a NAS share. The share is mounted on all of our servers. Aradmin is the owner of the share. In the PATH abc/def. If we are to use the newshellscript.sh to call shellscript.sh then we will need to put newshellscript.sh on all of our servers. There should be a way to get Remedy to recognize where shellscript.ksh exists without having to create another script in another PATH. Thanks. Roger A Nall Sr. Remedy Developer 7668 Warren Parkway Frisco, TX 75034 Desk: 972-464-3162 Cell: 973-652-6723 "You will get all you want in life, if you help enough other people get with they want" -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of Grooms, Frederick W Sent: Wednesday, October 23, 2013 11:57 AM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script Roger, In a unix script, lines that start with # are comments, except for the special case of the first line that starts with #! which tells the system which shell to use. Since you say the script will not execute on the server without the ksh in front of it then you probably need to find out why that is. Terry is correct that all executables in the script should be fully qualified (instead of relying on a script being run from a directory or the path being set a special way, ...). A workaround might be to do the following In the Escalation use: /usr/sbin/ksh /abc/def/ghi/shellscript.ksh In the script on line 2 add: cd /abc/def/ghi Also ... Should the first line of the script be /usr/sbin/ksh instead of /usr/bin/ksh Where is ksh in your system ( do "which ksh" to find it in your path and use that in both the escalation and the script)? Fred -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of Nall, Roger Sent: Wednesday, October 23, 2013 11:01 AM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script ** Terry, The first line in the script is #!/usr/bin/ksh which should actually preclude the need to put ksh in front of file name, at least in some circles. However, we did find that the script would not execute on the server without the ksh in front of the file name which is why I added ksh in my command line format. The form that we are using only has one record in it so I think we are covered there. I am thinking that like on the server we need to get to the ghi directory first. My problem is I do not know how to represent that in the command line format. I will try you suggestion of /usr/sbin/ksh /abc/def/ghi/shellscript.ksh. Also, I always thought that a line in a script (program, procedure) that began with # meant that the line should be ignored. So would that mean that the first line #!/usr/bin/ksh is being ignored which would be why we need to add the ksh in front of the filename? Thanks, Roger A Nall Sr. Remedy Developer 7668 Warren Parkway Frisco, TX 75034 Desk: 972-464-3162 Cell: 973-652-6723 "You will get all you want in life, if you help enough other people get with they want" -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of tboot...@objectpath.com Sent: Wednesday, October 23, 2013 10:28 AM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script ** Roger: I noticed something in the format of your command line. Shouldn't it read: /usr/sbin/ksh /abc/def/ghi/shellscript.ksh not /abc/def/ghi/ksh shellscript.ksh ? Inside shellscript.ksh, ensure that all your paths to executables and files are fully qualified. Do not assume that this shellscript.ksh has to be only run from a current working directory of /abc/def/ghi . Give it a shot. As for how often you run this escalation, it is not the frequency that I am concerned about, but the number of records that match the qualification of the escalation. Can there by 100's , or only 1 or 2 ? Terry P.S (you could also try /abc/def/ghi/ksh ./shellscript.ksh (notice the ./ in front of your script name). While it may work, I would still change my script to be able to be run from any current working directory) -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of Nall, Roger Sent: Wednesday, October 23, 2013 10:10 AM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script ** Terry, You are correct in that we were unable to execute the script by issuing the command /abc/def/ghi/ksh shellscript.ksh. We had to get directly to the ghi directory before the ksh shellscript.ksh would execute. We will only be looking to run the escalation once or twice a day. Would it be any better to set a field via an escalation and running the script using a filter? Thanks, Roger A Nall Sr. Remedy Developer 7668 Warren Parkway Frisco, TX 75034 Desk: 972-464-3162 Cell: 973-652-6723 "You will get all you want in life, if you help enough other people get with they want" -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:arslist@ARSLIST.ORG] On Behalf Of tboot...@objectpath.com Sent: Wednesday, October 23, 2013 9:43 AM To: arslist@ARSLIST.ORG Subject: Re: Execute shell script ** It's probably something associated to your environment variables. Try this: - Log into the server as the same userid that is running arsystem (usually 'root' for *nix) - Issue the command '/abc/def/ghi/ksh shellscript.ksh' (instead of just ./shellscript.ksh) - See if it still runs. I suspect that there are path issues associated with the default korne shell that aren't allowing you to run. Also, be very careful when running scripts via Escalations. The last thing you want are 100's of shell scripts running concurrently on your server and bringing the system to a halt. You should also consider whether your script behaves properly if multilple instances of it are running concurrently. HTH. Terry -----Original Message----- on Oct 23, 2013, Nall, Roger wrote: ** ARS - 7.1 sp4 Oracle 10g AIX We are trying to execute a shell script from an escalation. Our command line looks like this /abc/def/ghi/ksh shellscript.ksh The escalation fires however nothing happens. We are able to log into the box as aradmin and execute the script just fine but not from Remedy. I was wondering if anyone has any suggestions as to what we may be missing. Thanks, Roger A Nall Sr. Remedy Developer 7668 Warren Parkway Frisco, TX 75034 Desk: 972-464-3162 Cell: 973-652-6723 "You will get all you want in life, if you help enough other people get with they want"; _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org "Where the Answers Are, and have been for 20 years"