[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] shell pipe/cmd-chain as job command/argument in python bindings

ah, OK - no problem, a script should be fine (hoped that I could be extra lazy)

Cheers and thanks,

On 03/03/2021 16.13, John M Knoeller wrote:
Hi Thomas,  sorry to say but a short script is the only way to go here.

The && doesn't work when we try and pass it to /usr/bin/bash as an argument.

This works interactively because the shell you are using to run the command does not pass && down to the program being started, but treats the && and what comes after as a command to itself.


*From:* HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of Thomas Hartmann <thomas.hartmann@xxxxxxx>
*Sent:* Wednesday, March 3, 2021 4:53 AM
*To:* HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
*Subject:* [HTCondor-users] shell pipe/cmd-chain as job command/argument in python bindings
Hi all,

I just tried to submit a quick job with the Python bindings, where I
attempted to run just a few shell commands. I juggled a bit with the
position of the execs in the `Cmd` and `Args` keys - but all failed [1]

So, I tried to wrap the &&-chained commands into one string-argument and
use the shell as executable [2] (not the most elegant approach...).
However, it also failed for me :-/
(I guss the behaviour is similar for submissions through the CLI)

Is there a way to get it running - or is a short script the only way to


      jobAd["Cmd"] = '/usr/bin/env'
      jobAd["Args"] = '&& /usr/bin/cat .job.ad && echo "FOO" '

which actually cat'ed me `echo` - I guess the shell interpretation of
operators like `&&` is not possible here, or?

      jobAd["Cmd"] = '/usr/bin/bash'
      jobAd["Args"] = '-c "/usr/bin/cat .job.ad && /usr/bin/echo \FOO\"" '

HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting

The archives can be found at:

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature