[Top][All Lists]

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

[bug #10678] xargs: unmatched single quote

From: James Youngman
Subject: [bug #10678] xargs: unmatched single quote
Date: Sun, 20 Aug 2006 09:02:42 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv: Gecko/20060731 Ubuntu/dapper-security Firefox/


                 Summary: xargs: unmatched single quote
                 Project: findutils
            Submitted by: zurd
            Submitted on: Friday 15/10/04 at 01:29
                Category: xargs
                Severity: 2 - Minor
              Item Group: None
                  Status: Invalid
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Closed
                 Release: None
           Fixed Release: None



>From package 4.1.20-r1

xargs doesn't offer an option to bypass a quote (') when there is one in the
filename or directory.

How-to reproduce :
1) mkdir "test'"
2) ls -1 | xargs -x -i "{}" new_test

Actual results:
xargs: unmatched single quote

What it should do:
Change the directory called test' to new_test


Follow-up Comments:

Date: Sunday 20/08/06 at 08:09      By: Feiyun Wang <feiyunw>
I use "sed" and "tr" to walk around this bug:
find -mindepth 2 -type f | sort -S 4M > $$newmd5.file
sed -e "s/^\(.*\)$/\"\1\"/" $$newmd5.file | tr -s \r\n \0 | xargs -0 -r
md5sum >> $$md5sum

Date: Tuesday 19/04/05 at 11:24     By: Zurd <zurd>
Thanks James for the warning message in xargs about the unmatched single
quote, it's much better now :-)

Helps to debug a command when you have an unmatched single quote and you want
to make it work.

Sorry for the 6 months delay reply, savannah didn't include me by default in
the Carbon Copy list :(

Date: Friday 22/10/04 at 17:18      By: James Youngman <jay>
If you want to avoid quote processing, use the -0 option.   I have updated
the error message in CVS to point this out.

Date: Friday 15/10/04 at 17:41      By: Bob Proulx <rwp>
The -0, --null option was designed for just these cases.  Unfortunately ls is
not the best tool to produce null terminated strings.  But 'find' is good

Your 'ls -1' command is roughly equivalent to 'find . -maxdepth 1'.  Use
find's -print0 option and xarg's -0 option to protect against unusual file

  find . -maxdepth 1 -print0 | xargs -r0

Does this address your issue?

Date: Friday 15/10/04 at 10:06      By: James Youngman <jay>
Unfortunately this is the way that xargs(1) is supposed to behave.   I agree
it's undesirable in many ways, but GNU Findutils' xargs is supposed to be
compatible with other implementations of xargs, which means making it work in
this way.

This bug report will be treated as an enhancement request to provide a way of
solving this problem.  Perhaps an option to turn off quote processing and EOF
marker processing.


Carbon-Copy List:

CC Address                          | Comment
Available only the item webpage     | 
Available only the item webpage     | 


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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