Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 2010 02:46:23 +0900 (JST)
From:      Tod McQuillin <devin@spamcop.net>
To:        Garrett Cooper <yanefbsd@gmail.com>
Cc:        FreeBSD-Hackers <freebsd-hackers@freebsd.org>, Jan Mikkelsen <janm@transactionware.com>
Subject:   Re: read(1) garbage when input redirected from make incorrectly
Message-ID:  <20100217024315.O62495@plexi.pun-pun.prv>
In-Reply-To: <7d6fde3d1002160901r600bb514u4a3219d2e59b16aa@mail.gmail.com>
References:  <364299f41002151649y2e4d4120p918759afb1fd8f6c@mail.gmail.com> <7d6fde3d1002151655q184c8a21k8a0c6c07b9b0ae79@mail.gmail.com> <BC288C06-614D-4097-901E-5CBECCCC215F@transactionware.com> <7d6fde3d1002160901r600bb514u4a3219d2e59b16aa@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100217024315.O62495>