tail command : differences between solaris and linux
On 03Aug2008 11:39, Skunk Worx <firstname.lastname@example.org> wrote:
> I've noticed if I try to install the JMF (Java Media Framework),
> downloaded from Sun Micro, the script fails :
> $ sh ./jmf-2_1_1e-linux-i586.bin
> $ Unpacking...
> tail: cannot open `+309' for reading: No such file or directory
> ./install.sfx.5451: line 1: ==: No such file or directory
> ./install.sfx.5451: line 3: syntax error near unexpected token `)'
> ...and the script ends up zero-length.
> ...and if I restore the file, then change the tail command that is
> trying to dump out the code section :
> $ sed -i 's/tail +309/tail -n +309/g' jmf-2_1_1e-linux-i586.bin
> ...it's ok.
> So, they use "tail +309" and Fedora 9 needs "tail -n +309". Google shows
> people have seen this under Ubuntu as well.
The latter syntax is POSIXly correct. Looks like they've got
historic usage on Solaris in their script. Certainly historicaly
tail -100 file
for the _last_ 100 lines has been supported forever (though not required
by POSIX, which made all command line options conform to the standard
forms, hence the -n), and on Solaris it looks like a bare +number is
supported just like the bare -number.
But a quick check on a Gentoo box here does not support +number. A check on
MacOSX _does_ support +number. So it looks like the GNU tools are a bit
less helpful here, though still standard compliant.
Sun _should_ be shipping their script with "tail -n +309", unless
Solaris doesn't support that. It's quite possible that on Solaris
/bin/tail does not accept -n, and another version (eg in /usr/xpg4/bin)
would. But they must ship their script to work with the default
/bin/tail on Solaris. And before you whinge about that being deficient,
they may have left /bin/tail unchanged because that keeps their
customers' scripting expectations stable. Plenty of vendors have
to keep things stable for the "installed base". The same effect is why a
RedHat Enterprise box runs "old" software, and backports security and
bug fixes to the older code instead of upgrading to "current" - it keeps
the platform stable, and for enterprise stuff that's important.
Of course, the portable thing it to just move to saying:
instead of using "tail +number". Portable, stable.
Cameron Simpson <email@example.com> DoD#743
WHAT"S A ""K3WL D00D"" AND WH3R3 CAN 1 G3T S0M3!!!!!!!!!!!????????
- Darren Embry
fedora-list mailing list
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list