看板 FB_bugs 關於我們 聯絡資訊
>Number: 137659 >Category: bin >Synopsis: sh(1): /bin/sh fails to redirect stderr in backticks >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 11 07:30:09 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Yar Tikhiy >Release: FreeBSD 8.0-BETA2 amd64 >Organization: BarNet >Environment: System: FreeBSD ref8-amd64.freebsd.org 8.0-BETA2 FreeBSD 8.0-BETA2 #11 r195838: Fri Jul 24 09:52:42 UTC 2009 simon@ref8-amd64.freebsd.org:/scratch/src/sys/amd64/compile/REF8-AMD64 amd64 >Description: If the command to run in backticks has no path and the shell fails to run it, the stderr message cannot be redirected. For comparison, bash redirects OK in both cases. >How-To-Repeat: Compare the following two cases. In case 1, the "not found" message is properly redirected to stdout and assigned to a variable while in case 2 it's just emitted immediately, defying redirection. $ out=`/var/empty/foo 2>&1` $ echo $out /var/empty/foo: not found $ out=`nosuchtool 2>&1` nosuchtool: not found $ echo $out $ >Fix: >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"