NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/42184: /bin/sh: stderr vs. command not found



The following reply was made to PR bin/42184; it has been noted by GNATS.

From: David Laight <david%l8s.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/42184: /bin/sh: stderr vs. command not found
Date: Wed, 14 Oct 2009 20:17:26 +0100

 On Wed, Oct 14, 2009 at 06:20:00PM +0000, cheusov%tut.by@localhost wrote:
 > >Number:         42184
 > >Synopsis:       /bin/sh: stderr vs. command not found
 ...
 > /bin/sh doesn't print "xxx: not found" to stderr
 > in case xxx cannot be found.
 > 
 >    1 ~>cat /home/cheusov/tmp/1.sh                      
 >    #!/bin/sh
 > 
 >    bad_command_name 2>/dev/null
 
 Actually, it does print the error message to stderr.
 It does so in its own context, not that the command would run in.
 So the redirect on the line itself has no effect.
 
 The TOG spec:
 http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html
 does seem to imply that redirection be done before command lookup!
 
 However this is all hard! The 'command environment' doesn't exist
 until later ...
 
        David
 
 -- 
 David Laight: david%l8s.co.uk@localhost
 


Home | Main Index | Thread Index | Old Index