1

I am getting error when calling OS command for Peoplecode using EXEC function. The call is like this

CommitWork();

   &ShellCommand = "/path/mytest.sh param1 param2";

   &ReturnCode = Exec(&ShellCommand, %Exec_Synchronous + %FilePath_Absolute);

The &ShellCommand is built using the path, executable and parameters to be passed as shown above. That command works fine when executed independently.

I keep getting error 255. Is there anything about the syntax? Does anybody have a tested or working example or any suggestion?

user7926822
  • 21
  • 1
  • 5

3 Answers3

1

Thank you guys for responding. The command was running fine from shell scripts but not from Peoplesoft. It turned out that the current folder on the application server was not correct. So I added a CD command as the first line in the shell script to change current folder to the correct folder. That worked. Thanks again.

user7926822
  • 21
  • 1
  • 5
0

the syntax looks correct. I use similar code to call bat files.

    Exec("C:\windows\system32\cmd.exe /c C:\Test\mybat.bat param1 param2", %Exec_Synchronous+%FilePath_Absolute);

Have you tried with an absolute path instead of a relative path?

Robin Debruyne
  • 438
  • 2
  • 6
0

error code 255 seems to be an out of range error code.

see http://tldp.org/LDP/abs/html/exitcodes.html

I would check the assumptions that you're making. Is the same username running the shell script, your username vs the app server username? Is the environment set up the same way for the app server username vs your username? file permissions