[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about xargs
From: |
Eric Blake |
Subject: |
Re: Question about xargs |
Date: |
Wed, 02 Apr 2008 23:06:41 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Vladimir Giszpenc on 4/2/2008 8:08 AM:
| Hello,
|
| I was wondering if there was a way to handle spaces in filenames (as an
| enhancement). Newlines supposedly cause problems too, but I don't think
| I have ever seen a file with one. However, spaces in filenames are
| common.
|
| Could they be escaped or quoted?
Try find's -print0 action, as well as xargs' -0 option. By using a NUL
terminator rather than space or newline, you can handle arbitrary file
names safely. The manual contains other examples of how to properly
handle problematic file names.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkf0ZeAACgkQ84KuGfSFAYBOvgCcCXh8u5ilXUKUA6AUPyc0ViaJ
CkgAn36PKU9y4c4deYpASlMH0gV6zjkU
=+ish
-----END PGP SIGNATURE-----