[Top][All Lists]

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

Re: problems with file names containing \n

From: Werner LEMBERG
Subject: Re: problems with file names containing \n
Date: Fri, 07 May 2004 14:22:49 +0200 (CEST)

> What is strash?

strash is a shell script which accompanies the libtrash library to
remove deleted files (which are saved in a special trash directory)
with, say, cron.

> 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

> 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'?
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).


reply via email to

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