bug-bash
[Top][All Lists]
Advanced

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

Re: How to deal with space in command line?


From: Chris F.A. Johnson
Subject: Re: How to deal with space in command line?
Date: Sat, 18 Sep 2010 22:26:11 -0400 (EDT)
User-agent: Alpine 2.00 (LMD 1167 2008-08-23)

On Sat, 18 Sep 2010, Peng Yu wrote:

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?

   This will supply as many files as possible as arguments to stat:

find . -type f -exec stat --printf "%y %n\n" +

--
   Chris F.A. Johnson, <http://cfajohnson.com>
   Author:
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)



reply via email to

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