URL: <http://savannah.gnu.org/bugs/?10678>
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 _______________________________________________________ Details: >From package 4.1.20-r1 Description: 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 here. 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 names. 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: <http://savannah.gnu.org/bugs/?10678> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-findutils mailing list Bug-findutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-findutils