[csw-maintainers] Perl scripting question

Juergen Arndt ja at opencsw.org
Fri Apr 15 09:14:12 CEST 2011


I tried it on linux and solaris with sh, bash, zsh, ksh and csh and every time I get the effect as described. 

On 15.04.2011, at 07:42, Philip Brown wrote:

> 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" )'
>> 
> _______________________________________________
> maintainers mailing list
> maintainers at lists.opencsw.org
> https://lists.opencsw.org/mailman/listinfo/maintainers
> .:: This mailing list's archive is public. ::.


-- 
Juergen Arndt



More information about the maintainers mailing list