Apr 05, 2010 16:03
I am sick and tired of the following error message:
xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
So, here is a solution, zargs.sh:
#!/bin/sh
sed "s/'/\\\\'/g" | xargs -I {} $* "{}"
You should be able to chmod +x it and use it just like you'd use xargs, provided that you are me. I've tested it a fair amount so hopefully it works for you. I'm only posting this here because I suspect it might get spidered by Google and help someone else out. I hate that error, and the -0 option is not a solution at all, unless you want to perform extensive rewrites of the output of the preceding steps.
solution,
script,
unix,
error,
sh,
code,
shell,
xargs,
bash,
sed