|
From: | Linda Walsh |
Subject: | Re: How to deal with space in command line? |
Date: | Mon, 20 Sep 2010 12:35:09 -0700 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 |
Peng Yu wrote:
Hi, stat --printf "%y %n\n" `find . -type f -print` I could use the following trick to stat each file separately. But I prefer to stat all the files at once. I'm wondering if there is any easy way to converted the strings returned by find if there are special characters such as space by adding '\' in front them? http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html
----- Does your situation require performing all the stats in one invocation? Is there a reason you couldn't use null-terminated filenames? They were designed specifically for this purpose (to quote all other characters, as nulls are illegal in filenames): find . -type f -print0 |xargs -0 stat -printf "%y %n\n"
[Prev in Thread] | Current Thread | [Next in Thread] |