This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: "tail +140" no longer works.
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Dave Korn <dave dot korn dot cygwin at googlemail dot com>, binutils at sourceware dot org
- Date: Fri, 13 Mar 2009 04:41:02 +0000
- Subject: Re: "tail +140" no longer works.
- References: <49A639A6.2070703@gmail.com> <20090227021634.GL6783@bubble.grove.modra.org> <49ABF409.7070801@redhat.com>
Nick Clifton wrote:
> Hi Dave,
>
>>> diff -u -p -r1.15 bootstrap.exp
>>> --- ld/testsuite/ld-bootstrap/bootstrap.exp 6 Jul 2007 14:09:42
>>> -0000 1.15
>>> +++ ld/testsuite/ld-bootstrap/bootstrap.exp 26 Feb 2009 04:44:23
>>> -0000
>>> @@ -152,8 +152,8 @@ foreach flags {"" "strip" "--static" "--
>>> # Although this works, a way to set the date would be better.
>>> # Removing or zeroing the date stamp in the binary produced by
>>> # the linker is not possible as it is required by the target
>>> OS.
>>> - exec tail +140 tmpdir/ld2 >tmpdir/ld2tail
>>> - exec tail +140 tmpdir/ld3 >tmpdir/ld3tail
>>> + exec tail -n +140 tmpdir/ld2 >tmpdir/ld2tail
>>> + exec tail -n +140 tmpdir/ld3 >tmpdir/ld3tail
>>> catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
>>> exec rm tmpdir/ld2tail tmpdir/ld3tail
>>> } else {
>
>> It seems very odd to me that we are skipping 140 lines. tail -c +140
>> makes more sense, which is one past external_PEI_filehdr.f_timdat.
>> However, I think you will need to skip PEAOUTHDR.CheckSum as well, so
>> tail -c +220.
>
> I agree with Alan. Can you confirm whether "tail -c 220" works or not ?
> It might even be better to use "tail --bytes=220" for more clarity.
Confirmed that "tail -c +140" fails and "tail -c +220" (note '+'
accidentally omitted in Nick's post) works perfectly.
How portable is this though? I'm a bit out of date but I seem to remember
Solaris having a quirky set of command-line options. Should we consider an
alternative solution using some/any/all of od/sed/grep-v maybe?
cheers,
DaveK