exec command for linux

I am trying to execute a series of linux commands using exec and they don’t work. A simple test I am using:

exec(’/bin/sh’, ‘-c “echo Total Files Received: [$GV_RecvdCount] >> [$GV_BK_OUTPUT_FILE_PATH]/BKDailylog.txt”’ ,8);

any help please…


etlbods (BOB member since 2018-10-11)

when you put quotes “around a bunch of words with spaces in between them” you turn them all into one big argument.


jlynn73 :us: (BOB member since 2009-10-27)

So, how do you recommend doing this requirement ?


etlbods (BOB member since 2018-10-11)

Anyone have any suggestion ? anybody encountered this requirement ? how are you handling it ?
BODS has issues when executing linux/unix commands with spaces in the arguments…any fixes or workarounds will be a great help !!


etlbods (BOB member since 2018-10-11)

Would also like to know how this is resolved. I am currently using an exec command to call a vb script but it doesn’t seem to be working.

Make absolutely certain the server can reach the path.

Run a couple really simple test scripts.

Do a print(); function on the DS string that is going to be executed. Its often not what you think it should be.

Most of us could write your code for you but I would strongly suggest you learn to do this yourself and try as much as possible to NOT GUESS. When working at a command line its far too easy to make a horrible mistake and nobody here wants to be responsible for that. My .02 8)


jlynn73 :us: (BOB member since 2009-10-27)