Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Nov 1996 13:20:04 -0800 (PST)
From:      Archie Cobbs <archie@whistle.com>
To:        current@FreeBSD.org
Subject:   Re: find and xargs in /etc/security
Message-ID:  <199611252120.NAA02696@bubba.whistle.com>
In-Reply-To: <Pine.BSF.3.95.961124193116.12070J-100000@alive.ampr.ab.ca> from Marc Slemko at "Nov 24, 96 07:39:45 pm"

next in thread | previous in thread | raw e-mail | index | archive | help

> Now that xargs has a -0 option to allow it to use the output from find
> -print0, perhaps /etc/security should be updated to use these options so
> we get rid of the garbage output caused by things such as files with
> spaces in their name? 

This brings up another thing that has always bugged me. From the find(1)
man page:

  -X  The -X option is a modification to permit find to be safely used
      in conjunction with xargs(1).  If a file name contains any of the
      delimiting characters used by xargs,  a diagnostic message is
      displayed on standard error, and the file is skipped.  The delim-
      iting characters include single (`` ' '') and double (`` " '')
      quotes, backslash (``\''), space, tab and newline characters.

This is saying, ``If it will confuse xargs, don't print it.'' Why not
instead ``If it will confuse xargs, insert backslashes as appropriate'' ?!?
I mean, if find(1) already knows what characters it needs to escape for
xargs, why not just go ahead and escape them?!? Jeez.

>From man xargs(1):

  Spaces, tabs and newlines may be embedded in arguments using single
  (`` ' '') or double (``"'') quotes or backslashes (``\'').  Single quotes
  escape all non-single quote characters, excluding newlines, up to the
  matching single quote.  Double quotes escape all non-double quote charac-
  ters, excluding newlines, up to the matching double quote.  Any single
  character, including newlines, may be escaped by a backslash.

Howabout a new find(1) option that does this? Or better yet, just fix
the "-X" option to work like it should in the first place.

Just my $.02..

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611252120.NAA02696>