Peoplesoft : Unix command returning error code 1 from EXEC() but working from putty

445 views Asked by At

I am trying to run below command from EXEC() peoplecode but getting return code 1.

&cmd = tail -n +2 /dirname/filename.csv | split -d --lines 20 - --filter='bash -c "{ head -n1 /dirname/filename.csv; cat; } > $FILE"' --additional-suffix=.txt /dirname/filename.csv_;

CommitWork();

&returncode= Exec(&cmd, %Exec_Synchronous + %FilePath_Absolute);

The command is working as expected from command line. Any help will be appreciated.

1

There are 1 answers

0
ZeusT On

I'm assuming the &cmd is quoted properly and just a formatting issue here in SO.

On the command line, after you test the cmd, do echo $?to show the return code on the last command. If it does show 1, but is 'correct', you take a look at:

How to return exit code 0 from a failed command