Hi srujan G,
Try to print the path by using the print function. below is the example how to use the exec function.
Try calling like
exec('/usr/sap/project/script.sh','',8);
By using Print function check it's path.
Print(exec('bin/sh',' cd /usr/sap/project/script.sh',8));
In the above script. i think you are using '.'in between the parameters. It should be ",".
Syntax
exec(command_file, parameter_list, flag)
Example:
The examples below can be used with NT or UNIX.
If you were using the first two examples for UNIX, substitute 'sh', 'csh', 'ksh', 'bash' or 'tcsh' for 'cmd'. Also, the first two examples call 'cmd' rather than the program directly.
You need to use 'cmd' (or its equivalent) if either: • The "command" is a built-in of the shell (e.g., 'DIR' is not a program in NT) • Piping (a single '|' in an argument) occurs • In either NT or UNIX, the vertical bar symbol sends the output of one command to another command. Only use a vertical bar inside quotes. In Data Services, thedoubleverticalbar symbol (||) concatenates strings. Only use a double vertical bar outside quotes. Also, remember that the '\', '/' symbols are interchangeable when using NT.
However, only '/' is accepted as a directory separator on UNIX.
exec('cmd', 'dir ' || $filename, 8); exec('cmd', 'x:/bin/program1.exe | x:/bin/postprocess.bat', 4);
exec(SRC.PROGNAME, ARGTBL.ARGS || ' lastArg', 2);
exec('c:\Data Services\bin\clone_and_rename.bat', TBL.FNAME, 1);
exec('C:\Perl5\bin\perl.exe', 'C:\sandbox\stats.pl 20 50 3000', 0);
Regards,
Akhilesh Kiran.
