[Top][All Lists]

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

Re: problems with file names containing \n

From: Andreas Metzler
Subject: Re: problems with file names containing \n
Date: Fri, 7 May 2004 14:38:53 +0200
User-agent: Mutt/

On Fri, May 07, 2004 at 02:22:49PM +0200, Werner LEMBERG wrote:
> > Could it really handle this, i.e.  strash 'foo\nbar' will try to
> > access
> > 'foo
> > bar'
> > and not the file named "foo backslash n bar"? (That is how any sane
> > program would behave?) How would you access a files name 'foo\nbar'
> > with strash?

> The output of `find' is sent to `sort', and the trailing newline
> character is sorted first -- something which the script doesn't
> expect.
> > The usual GNU-way for this issue is to modify the program in
> > question (strash) to accept a NUL delimited list like sort -0 does.
> Thanks for the hint, but how can this be combined with `-printf'?

Usually -print0 is used.

> According to the info pages for find 4.1.7, there is no way to pass a
> zero byte; this is, -printf "%p\0" is not allowed.  I suggest to
> extend the escape support, making it possible to emit arbitrary
> characters in octal and hexadecimal representation (as \nnn and \xnnn,
> similar to bash).

You should have tried. ;-) GNU find does support \nnn, it just is not
documented in this version. (It s documented in CVS).
              cu andreas

reply via email to

[Prev in Thread] Current Thread [Next in Thread]