AutoSys Workload Automation

  • 1.  Has anyone had a problem with using piping commands on an job running on AIX?

    Posted Mar 23, 2018 02:48 PM

    I am trying to do some simple piping commands, and I am unable to get AIX to do them.

    examples:

    cat file1.txt >> file2.txt

    file2.txt is created, but with 0 bytes

     

    cat file1.txt | wc -l

    The standard output is the contents of file1.txt. as if the wc -l wasn't even there.

     

    could it be a setting in my agent parm that isn't correct?



  • 2.  Re: Has anyone had a problem with using piping commands on an job running on AIX?

    Posted Mar 23, 2018 03:18 PM

    Did you try running one command per job, using std_out_file and std_in_file?



  • 3.  Re: Has anyone had a problem with using piping commands on an job running on AIX?

    Posted Mar 23, 2018 03:30 PM
      |   view attached

    But I can do the same commands on a Linux agent without a problem. From the AIX command line, I can run the commands correctly, but with Autosys, they don’t seem to make it to the console…

     

    Chris



  • 4.  Re: Has anyone had a problem with using piping commands on an job running on AIX?

    Posted Mar 23, 2018 03:37 PM

    Shells might have the same names between Linux and AIX but not the same evolution.

    I have some command jobs that work with pipes in AIX.

    There are some agent parameters that control shell access and use.

    For simplicity, I'd recommend one command per job.



  • 5.  Re: Has anyone had a problem with using piping commands on an job running on AIX?
    Best Answer

    Posted Mar 25, 2018 07:09 PM

    Hi Chris,

    The following works with the default "WAAE compatibility enabled" via the installer.

     

    /* ----------------- test_pipe_on_aix ----------------- */

     

    insert_job: test_pipe_on_aix   job_type: CMD
    command: cat /tmp/file1.txt | wc -l
    machine: ibm20ak
    owner: autosys
    permission:
    date_conditions: 0
    std_out_file: "/tmp/$AUTO_JOB_NAME.log"
    std_err_file: "/tmp/$AUTO_JOB_NAME.err"
    alarm_if_fail: 1
    alarm_if_terminated: 1

     

    # cat /tmp/file1.txt
    abracadabra
    abra
    ca
    dabra

    # cat /tmp/test_pipe_on_aix.log
           4

     

    What shell is the job owner user defaulting to? KSH? or CSH/TCSH?

     

    Thank you,

    Chandru



  • 6.  Re: Has anyone had a problem with using piping commands on an job running on AIX?

    Posted Mar 26, 2018 09:59 AM

    Since AutoSys was written it was always considered bad form to redirect on commandline. and to use std_out_file and std_err_file and std_in_file. And the fact it may go away or not work properly.

     

    Also to refrain from cmd&&cmd2 etc

    a Caveat of cmd|cmd2 was always made because its the output of one to the command of the second and you will only get return code of second.

     

    when you see odd behavior that is a wakeup call to properly create jobs in code Shell/Perl etc.. 

     

    just my 3 cents and 

    Hope that helps

     

    Steve C.