1

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.

qyb2zm302
  • 6,458
  • 2
  • 17
  • 17
deansamy
  • 11
  • 1

1 Answers1

1

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

ZeusT
  • 515
  • 2
  • 8