bug-findutils
[Top][All Lists]
Advanced

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

problems with file names containing \n


From: Werner LEMBERG
Subject: problems with file names containing \n
Date: Fri, 07 May 2004 07:50:39 +0200 (CEST)

[strash 0.9
 find 4.1.7]

I've managed somehow on my GNU/Linux box to have a file name which
contains a newline character.  `find -ls' reports this:

  478966    4 -rw-r--r--   1 sx0005   users         209 Apr 27 00:17 \
    ./SYSTEM_ROOT/usr/local/home/sx0005/KS09.wmv?MSWMExt=.asf\n

Doing e.g. `find . -printf "%p\n"' I get

  ./SYSTEM_ROOT/usr/local/home/sx0005/KS09.wmv?MSWMExt=.asf

followed by a *two* real newline characters.

Such a file name makes strash fail with

  /usr/local/bin/strash: [: -lt: unary operator expected

since it doesn't expect real newlines.

While it isn't a bug per se that find's `%p' converts the file name's
newline character into a real one, it is a missing feature IMHO that
there is no possibility to suppress this behaviour.  I thus suggest a
modifier to %p and friends which makes the output similar to -ls,
e.g. `%lp' (`l' as the mnemonic for `ls').


    Werner




reply via email to

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