AutoSys Workload Automation

  • 1.  "||" and "&&" shell commands in the autosys co

    Posted Sep 01, 2009 08:17 AM
    Hi,  I want to embed a "||" in my autosys command.  It sort of works in that in a situation where "||" would NOT be executed, autosys exits cleanly, quietly and normally; but in an instance where it executes the command after it, I see " parent returned from wait, exit code 256 (0 1) " in the job log on the client, and a job fail.This implies that the shell is reading it correctly logically speaking!The command after the "||" is simply "/bin/date" (for now).  RegardsLL.  ps. here's an example (replace AAA and BBB with two variables, commands, whatever :-) )               [ AAA = BBB ] || /bin/date


  • 2.  Re: "||" and "&&" shell commands in the autosy

    Posted Sep 01, 2009 11:26 PM
    Not a good idea, put it into a shell script and execute the shell script.  Hendry


  • 3.  Re: "||" and "&&" shell commands in the autosy

    Posted Sep 01, 2009 11:47 PM
    Hendry_T,  Thanks, but why? I am trying to call a script from a company wide package that I don't want to change (globally!). To create another script would be to create a support "challenge" and be non-standard.  The fact that it exits successfully when the argument condition is FALSE suggests that it's a valid command that Autosys is parsing correctly.We know it's a valid sh / ksh / bash command line.The error code only exists when it tries to execute the FALSE condition (the bit after the ||).  Is this a bug in the Autosys product?!?!  Regards,LL.


  • 4.  Re: "||" and "&&" shell commands in the autosy

    Posted Sep 01, 2009 11:56 PM
    Hi LL,  No it is not a bug, because autosys allows the redirection of output and input and because it can only track the command that you are executing, redirection on the command and "||" and "&&" can have varied results. It does state in the manual that it is not supported. The 2 commands can be seperated into seperate jobs and using the conditions you can have it execute in exactly the same way. This will then be a proper solution and will work just as well.  Regards  Hendry


  • 5.  Re: "||" and "&&" shell commands in the autosy

    Posted Sep 08, 2009 06:25 AM
    This should work:   insert_job: pv74171_x
    command: ksh -c '[ "$AUTOSERV" = "$AUTOSYS" ] || /bin/date'
    machine: localhost
    std_out_file: /tmp/$AUTO_JOB_NAME.out.txt
    std_err_file: /tmp/$AUTO_JOB_NAME.err.txt