В Sun, 27 Apr 2014 22:23:18 +0200
"Carlos E. R."
On 2014-04-27 21:12, Anton Aylward wrote:
On 04/27/2014 02:54 PM, Carlos E. R. wrote:
a) The test for "regular file" is needed, because the find, despite using "find "$DONDE" -type f ..." finds some directories, and thus I get some errors later:
Possibly. Possibly not.
The thing is that find produces a stream
So if you have a file with the path
$HOME/Long Directory name/even longer file name dot text
then you will get the following path names
Long Directory name even longer file name dot text
What you need is to use "-print0" and "xargs -0"
No, that's not a problem. The output of find is saved to a text file, which thus contains one entry per line. For your sample above, I would get this line:
/home/cer/Long Directory name/even longer file name dot text
Which breaks if filename contains newline.
Then I use:
while read FILES ; do echo "$FILES" # or whatever. done < text_file_containing_list
Which loses consecutive whitespaces and performs "\" escaping.
Whitespace is not a problem this way.
Sure because you will lose them :)