"tail +140" no longer works.

Dave Korn dave.korn.cygwin@googlemail.com
Fri Mar 13 04:31:00 GMT 2009


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



More information about the Binutils mailing list