Re: tail command : differences between solaris and linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03Aug2008 11:39, Skunk Worx <skunkworx@xxxxxxxxxxx> 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...
> <snip>
> tail: cannot open `+309' for reading: No such file or directory
> Extracting...
> ./install.sfx.5451: line 1: ==: No such file or directory
> ./install.sfx.5451: line 3: syntax error near unexpected token `)'
> <snip>
>
> ...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
the usage:

  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:

  sed 1,308d

instead of using "tail +number". Portable, stable.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

WHAT"S A ""K3WL D00D"" AND WH3R3 CAN 1 G3T S0M3!!!!!!!!!!!????????
        - Darren Embry

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux