Re: undocumented (?) test -e behaviour with symbolic links

2016-09-30 Thread john slee
So it does. Not sure how I missed that, but I did. Oh well. Thanks :-/

John

On 1 October 2016 at 14:31, Theo Buehler <t...@math.ethz.ch> wrote:

> On Sat, Oct 01, 2016 at 01:38:49PM +1000, john slee wrote:
> > Not sure if folks are interested in this or not, but it sure caused me
> some
> > angst this morning. OSX has the same behaviour and also doesn't document
> > it. I assume it has been that way for a long, long time.
> >
> > My first patch. Thanks for all the cool stuff :-)
> >
> > Index: bin/test/test.1
> > ===
> > RCS file: /cvs/src/bin/test/test.1,v
> > retrieving revision 1.33
> > diff -u -p -r1.33 test.1
> > --- bin/test/test.1 16 Aug 2016 18:51:25 -  1.33
> > +++ bin/test/test.1 1 Oct 2016 03:37:23 -
> > @@ -92,7 +92,9 @@ exists and is a directory.
> >  .It Fl e Ar file
> >  True if
> >  .Ar file
> > -exists (regardless of type).
> > +exists, unless
> > +.Ar file
> > +is a dangling symbolic link.
>
> Thanks, but I think that we document it.  It seems unnecessary and
> inconsistent to add that caveat only to -e.  The manual says explicitly:
>
>  Symbolic links are followed for all primaries except -h and -L.
>
> So if your file is a dangling symbolic link, it is followed, and since
> the file it points to doesn't exist, the expression evaluates to false.
>
> POSIX is also unambiguous about this behavior:
>
>-e pathname
>  True if pathname resolves to an existing directory entry.
>  False if pathname cannot be resolved.
>
>[...]
>
>With the exception of the -h pathname and -L pathname primaries, if
> a
>pathname argument is a symbolic link, test shall evaluate the
>expression by resolving the symbolic link and using the file
> referenced
>by the link.
>
> >  .It Fl f Ar file
> >  True if
> >  .Ar file
>
>


undocumented (?) test -e behaviour with symbolic links

2016-09-30 Thread john slee
Not sure if folks are interested in this or not, but it sure caused me some
angst this morning. OSX has the same behaviour and also doesn't document
it. I assume it has been that way for a long, long time.

My first patch. Thanks for all the cool stuff :-)

Index: bin/test/test.1
===
RCS file: /cvs/src/bin/test/test.1,v
retrieving revision 1.33
diff -u -p -r1.33 test.1
--- bin/test/test.1 16 Aug 2016 18:51:25 -  1.33
+++ bin/test/test.1 1 Oct 2016 03:37:23 -
@@ -92,7 +92,9 @@ exists and is a directory.
 .It Fl e Ar file
 True if
 .Ar file
-exists (regardless of type).
+exists, unless
+.Ar file
+is a dangling symbolic link.
 .It Fl f Ar file
 True if
 .Ar file


Re: perlre(1) and substitution evaluations

2013-12-01 Thread john slee
On 30 November 2013 21:59, Lars Nooden lars.noo...@gmail.com wrote:

 perlre(1) seems to be missing information about substitution evaluations
 with the /e option.  The functionality is present in perl:


It is, however, already documented in perlop(1)

John


Re: hide kernel threads in ps?

2011-08-31 Thread john slee
On 1 September 2011 10:21, Uwe Stuehler u...@openbsd.org wrote:
 If -k would become free for other uses, just for consideration:
 - in FreeBSD and Solaris, -k is unused
 - in NetBSD, -k specifies the sort order
 - in Linux' procps, k specifies the sort order

-k in AIX /usr/bin/ps is documented as Lists kernel processes in the manpage.

This ps implementation has a split personality like Linux procps, in
that SysVish
and BSDish syntax both work.

AIX /usr/sysv/ps doesn't have a -k option.

Tru64 4.0 doesn't seem to support -k at all.

AIX is the only commercial UNIX I'm seeing in job listings these days, for what
that's worth.  Solaris seems to be a corpse, and the flies are
swarming.  I guess
people really don't need DTrace and ZFS after all ;-)

John