10-23-2009 6:11 PM
I have been trying all sorts of things to get this to work and I have been un-successful
I am trying to run the UNIX script using SM49. the command line that I am using is
/test/directory/bin/testmail.sh
the script testmail.sh looks like
#!/bin/ksh
/usr/bin/mailx -s testmail <email address>
I have tried all sorts of combinations to run this script
example
sh /test/directory/bin/testmail.sh
/test/directory/bin/testmail.sh %f
/test/directory/bin/testmail.sh %F
does anyone have any suggestions on how to get this to run successfully. once I get this to run successfully in SM49, I am going to try it in the intregration builder of my PI process.
10-23-2009 6:29 PM
10-23-2009 6:29 PM
10-23-2009 6:32 PM
I am getting the following
Can't exec external program (No such file or Directory) External program terminated with exit code 1
10-23-2009 7:08 PM
If you are sure /test/directory/bin/ exists and the file exists, check if you have permission issues. Can you log onto the operating system and navigate to this directory and execute this shell script? If not, then it is you who do not have access to this directory and the file.
10-23-2009 7:11 PM
I do not have access to the operating system
the only way I know of to access the operating system to do UNIX commands is thru SM49
10-23-2009 7:17 PM
So that is probably your problem. Even SM49 will use your user ID to check the permissions. Check with someone in basis who has access and test it through them or get the access and test yourself.
10-23-2009 8:16 PM
Hi,
considering authorization issues, you can use
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = 'LIST_DB2DUMP'
additional_parameters = l_path
operatingsystem = 'UNIX'
TABLES
exec_protocol = lt_btcxpm
...
EXCEPTIONS
to extract information about files on the server
I used this code to get detailed information for display including the attributes
LOOP AT lt_btcxpm ASSIGNING <btcxpm>
WHERE length > 57
AND ( NOT message+57 CO '. '
OR message+57 = '..' )
AND ( message(1) = 'd' OR
message(1) = 'l' OR
message(1) = '-' ).
l_srvfil-type = <btcxpm>-message(1).
IF l_srvfil-type = '-'.
l_srvfil-type = 'F'.
ENDIF." l_srvfil-type = '-'.
TRANSLATE l_srvfil-type TO UPPER CASE. "#EC TRANSLANG
l_srvfil-file = <btcxpm>-message+57.
CONDENSE l_srvfil-file.
l_srvfil-attri = <btcxpm>-message+1(9).
* l_srvfil-time = <btcxpm>-message+44(12).
l_srvfil-size = <btcxpm>-message+32(11).
APPEND l_srvfil TO lt_srvfil.
ENDLOOP." at lt_BTCXPM assigning <BTCXPM>.
pt_srvfil = lt_srvfil.
For the srvfil information I used this structure
BEGIN OF typ_srvfil,
%_box TYPE flag, "#EC *
type TYPE char01,
attri TYPE isp_rel,
file TYPE file,
name TYPE file,
size TYPE sytleng,
owner TYPE sy-uname,
mod_date TYPE sydatum,
mod_time TYPE syuzeit,
END OF typ_srvfil,
I do not remember exactly how the attribute information is resolved. In Unix all file system authorizations can be set as for the user, the group or for all and it can be read, write, execute granted. If you are no unix expert, ask one or google/wiki for some details.
I wrote a program for navigation, display, and some more functions on the file system which is too big to post here and is not fully system-independent. Not perfect but useful and more than 5 years old. Contact me by mail if you want it.
Regards,
Clemens
Edited by: Clemens Li on Oct 23, 2009 9:16 PM
10-27-2009 1:14 PM
the problem is solved.
there were special characters in the sheel script taht I did not know about. the UNIX admin had to use VI to edit the file and remove the characters.
12-14-2009 9:28 PM
Hi Everyone,
I have the same problem, but I create the SH on the VI editor directly on our AIX.
So, this don't solve my issue.
Can anyone help me?
Thanks a lot.
Sebastian.
12-28-2009 11:51 AM
Hi,
i created command using sm69 and assign the unix path and file. it is working when the file is having Read, write and execute permission.
for some security reason my administrator not giving the above permission.
is it possible to execute the unix script without permission. if possible then how?
Thanks.
Muthuraj.D
12-28-2009 7:23 PM
07-07-2011 3:58 PM
Keep in mind that a Unix/Linux command or a Unix/Linux script has to run in a shell (Korn, Bash, etc). If the path to your shell is not found, you'll get that failure "No such file or directory". So if you've confirmed that the script is indeed where it should be and that the permissions are what they should be, you might also have your Unix/Linux team confirm that the shell path is ok.
On our new RHEL5 servers, we had to put this link out there to resolve the problem:
ln -s /bin/bash /usr/bin/sh