Ticket #1805 (closed merge: fixed)

Opened 6 years ago

Last modified 4 years ago

"tail" is different under Solaris

Reported by: guest Owned by: igloo
Priority: normal Milestone: 6.10 branch
Component: Build System Version: 6.8
Keywords: Cc: Christian.Maeder@…
Operating System: Solaris Architecture: x86
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Every new shell-hack bears the risk of failing under solaris:

perl gen_flags.xsl.pl "ghc ghci" "/usr/local/lib/ghc-6.8.0.20071025" > flags.xsl
rm -f flags.xml
head -n 1 ../users_guide/flags.xml >> flags.xml
echo "<!DOCTYPE sect1 [<!ENTITY ndash  \"-\"> \
                       <!ENTITY ldquo  \"\`\"> \
                       <!ENTITY rdquo  \"'\">]>" >> flags.xml
tail -n +2 ../users_guide/flags.xml >> flags.xml
usage: tail [+/-[n][lbc][f]] [file]
       tail [+/-[n][l][r|f]] [file]
gmake[2]: *** [flags.xml] Error 2
gmake[2]: *** Deleting file `flags.xml'
Failed making all in man: 1
gmake[1]: *** [all] Error 1
gmake: *** [stage1] Error 1

Change History

Changed 6 years ago by guest

  • difficulty changed from Unknown to Easy (1 hr)
  • milestone set to 6.8.1

simply:.

tail +2 ../users_guide/flags.xml >> flags.xml

in docs/man/Makefile works under Solaris, Linux and MacOS for me (Christian). "tail +2" yields all lines but the first one.

(Also "head -1" works everywhere, but no need to change that)

Changed 6 years ago by igloo

  • owner set to igloo

Ho humm.

$ echo | tail +2
tail: Warning: "+number" syntax is deprecated, please use "-n +number"
$ tail --version
tail (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering.
$

POSIX/SUS specifies it with -n:  http://www.opengroup.org/onlinepubs/009695399/utilities/tail.html

I'll change it to $(SED) 1d. Hopefully that'll work everywhere.

Changed 6 years ago by igloo

  • type changed from bug to merge
  • milestone changed from 6.8.1 to 6.10 branch

Fixed in 6.8; needs merging to the HEAD.

Tue Oct 30 17:12:18 PDT 2007  Ian Lynagh <igloo@earth.li>
  * Replace "tail -n +2" with "sed 1d", as Solaris doesn't understand the former

    M ./docs/man/Makefile -1 +2

Changed 6 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Merged

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.