mndoci has asked for the wisdom of the Perl Monks concerning the following question:

I am not quite sure if this is a Perl issue or a shell issue, but I have a script from an external source which works fine on Linux but not on AIX. I apologize if it is not a Perl issue. The error seems to be in the following system call
system("time $RUNHOME/$jobfile >& $RUNHOME/gcp_${FilName}_${total}.gs. +out &");
Thanks
mndoci

"What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'

Edited 2001-05-09 by Ovid

Replies are listed 'Best First'.
(tye)Re: Confusing system call
by tye (Sage) on May 09, 2001 at 23:07 UTC

    That looks like csh syntax (the ">&" part). Change it to system("time $RUNHOME/$jobfile > $RUNHOME/gcp_${FilName}_${total}.gs.out 2>&1 &"); ...but that shouldn't have worked anywhere as system command are not supposed to be run via csh. Oh well.

            - tye (but my friends call me "Tye")
      Well on Linux I am on a t-shell, not a regular C-shell. On AIX I was on a C-shell. I am still having some shell-based trouble, but that is nto for this group.

      Thanks for your help
      mndoci

      "What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'
Re: Confusing system call
by nardo (Friar) on May 10, 2001 at 00:55 UTC
    >& redirects both stdout and stderr on some shells. time prints its output to stderr (this is useful because it allows you to redirect the program's stdout and just see the time info, but that's besides the point). You could try:
    system("time $RUNHOME/$jobfile > $RUNHOME/gcp_${FilName}_${total}.gs.out 2>&1 &") which should redirect both stdout and stderr to the $RUNHOME/gcp_${FilName}_${total}.gs.out file.

    Update Wow, must be smoking too much crack, I suggested the exact same thing that tye did and didn't even realize it.