Skip to main content
1-Visitor
July 5, 2017
Question

ACL sh command - getting values returned by the command executed

  • July 5, 2017
  • 1 reply
  • 3540 views

Hello,

I am new to ACL.

 

We are trying to use the sh command to call Tortoise SVN, and are hoping there is a way to get the value returned by the command that sh calls. For example, we were hoping something like this might work:

 

    local testVariable = sh svn commit C:\filepath\filename

    if(testVariable==0) { response('success'); }

    if(testVariable==1) { response('failure'); }

 

Where svn returns 0 or 1 for success or failure. We tried the above, and it doesn't work.

 

Does anyone know if there is anyway to use sh and get the value returned by the command it executes?

 

Thanks,

Will

 

1 reply

16-Pearl
July 7, 2017

I'm not sure "sh" can capture the output, but you could always call a .bat file that updates a shared .txt file, then have Arbortext open that .txt file after "sh" returns so you can read the results out of the file.

1-Visitor
July 12, 2017

Thanks, @GarethOakes. I appreciate the help. We'll give bat files a shot.

16-Pearl
July 13, 2017

I've also done something similar very recently with Perl, if you can call Perl from Arbortext then you can use the backticks syntax ($var = `mycommand.exe -param`;) to capture the output. To capture STDERR as well as STDOUT you just append 2>&1 to the command line($var = `mycommand.exe -param 2>&1`;).