[csw-maintainers] Perl scripting question

Philip Brown phil at bolthole.com
Fri Apr 15 07:42:29 CEST 2011


Its probably not so much solaris vs linux, as "what shell you had on
other box, vs solaris box".
if your shell happens to be set to a csh-derivative, i would think it
would not work?

On Thu, Apr 14, 2011 at 11:11 AM, Juergen Arndt <ja at opencsw.org> wrote:
> Hi All,
>
> in a software, written in perl, I stumbled over the following line of code:
>
>        exec("$cmds[$no]{command} 1>$tmp_stdout 2>$tmp_stderr");
>
> So a certain command should be executed and stdout and stderr should be redirected into a file.
>
> This works on linux, but not on Solaris, when the given command is not found. In this case stderr will not be redirected. Could someone explain, why perl works here in different ways and how could a workaround look like?
>
> As an minimal example I used: perl -le 'exec( "not_existing_command 2>my.stderr" )'
>


More information about the maintainers mailing list