From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 16 18:03:13 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B36481065676 for ; Tue, 16 Feb 2010 18:03:13 +0000 (UTC) (envelope-from devin@spamcop.net) Received: from mail.distalzou.net (203.141.139.231.static.zoot.jp [203.141.139.231]) by mx1.freebsd.org (Postfix) with ESMTP id 76B908FC15 for ; Tue, 16 Feb 2010 18:03:13 +0000 (UTC) Received: from plexi.pun-pun.prv ([192.168.7.29]) by mail.distalzou.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NhRVA-000H5k-1T; Wed, 17 Feb 2010 02:46:24 +0900 Date: Wed, 17 Feb 2010 02:46:23 +0900 (JST) From: Tod McQuillin X-X-Sender: devin@plexi.pun-pun.prv To: Garrett Cooper In-Reply-To: <7d6fde3d1002160901r600bb514u4a3219d2e59b16aa@mail.gmail.com> Message-ID: <20100217024315.O62495@plexi.pun-pun.prv> References: <364299f41002151649y2e4d4120p918759afb1fd8f6c@mail.gmail.com> <7d6fde3d1002151655q184c8a21k8a0c6c07b9b0ae79@mail.gmail.com> <7d6fde3d1002160901r600bb514u4a3219d2e59b16aa@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD-Hackers , Jan Mikkelsen Subject: Re: read(1) garbage when input redirected from make incorrectly X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 18:03:13 -0000 On Tue, 16 Feb 2010, Garrett Cooper wrote: > [gcooper@optimus ~]$ python -c 'import sys; sys.stdin.read()' < make -V > bash: make: No such file or directory > [gcooper@optimus ~]$ perl -e 'while (<>) { print; }' < make -V > bash: make: No such file or directory No, you have to say: python -c 'import sys; sys.stdin.read()' < /usr/bin/make perl -e 'while (<>) { print; }' < /usr/bin/make -V What was happening in your first example is that the actual file /usr/bin/make on disk is being read directly ... /usr/bin/make is never executed at all. That is why your hexdump showed an ELF header -- it came from /usr/bin/make which is an ELF executable. -- Tod