[csw-maintainers] Perl scripting question

Juergen Arndt ja at opencsw.org
Thu Apr 14 20:11:09 CEST 2011


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" )'

Thank you
Juergen

-- 
Juergen Arndt



More information about the maintainers mailing list