[ale] Re: Installing j2se on RHEL 3?

Michael Hirsch mdhirsch at gmail.com
Wed May 25 13:42:07 EDT 2005


On 5/24/05, Jim Popovitch <jimpop at yahoo.com> wrote:
> On Tue, 2005-05-24 at 21:03 -0400, Joe Steele wrote:
> > I think this behavior is controllable.  A vanilla version of tail (from GNU
> > coreutils-5.2.1) can be forced to exhibit the 'obsolete' behavior if the
> > environment contains the variable '_POSIX2_VERSION' set to some value less
> > than 200112.
> >
> > I don't know about RHEL, but FC3 uses a modified tail command so that the
> > only way to get the 'new' behavior is to define '_POSIX2_VERSION' >= 200112
> > and also define POSIXLY_CORRECT in the environment.
> >
> > To get the 'obsolete' behavior, I'd suggest trying:
> > export _POSIX2_VERSION=199209
> 
> Looking at source code for tail.c from RHEL ES3 coreutils-4.5.3 there is
> this comment: (where P is the command line parameters being evaluated,
> and POSIX textual version 1003.1-2001 is represented as the integer
> 200112):
> 
>   /* If P starts with `+' and the POSIX version predates 1003.1-2001,
>      or if P starts with `-N' (where N is a digit), or `-l', then it
>      is obsolescent.  Return zero otherwise.  */
> 
> So, by setting _POSIX2_VERSION=200112 one should expect 'tail -1
> somefile' to barf.  It doesn't.  However, looking further at tail.c
> shows that parse_obsolescent_option() continues after determining
> obsolescence and correctly parses +N, -N despite knowing they are
> obsolete.  (backwards compatibility == good)
> 
> However, if POSIXLY_CORRECT is set in the environment, then tail will
> NOT force the backwards compatibility and the user will get an error
> like this:
> 
>    tail: `-1' option is obsolete; use `-n 1'

Very keen detective work.  For my version of tail the POSIXLY_CORRECT
doesn't seem to matter:

bash-2.05b$ set | grep POSIX
bash-2.05b$  tail -1 .bashrc
tail: `-1' option is obsolete; use `-n 1'
Try `tail --help' for more information.

But the _POSIX2_VERSION variable does seem to solve the problem.

bash-2.05b$  _POSIX2_VERSION=199209 tail -1 .bashrc
export FOO=barbash-2.05b$ 

But the more I look at this system the more I see that it is not in
its pristine state.  I'm no longer convinced that RHEL has the bad
tail, but maybe the administrator compiled his own version.

Thanks everyone,

Michael



More information about the Ale mailing list