xargs: unmatched single quote
I am trying to do a replacment of the user and group nobody:nobody with apache:apache. chown is missing files, and xargs is giving me the following:
find / -user nobody -group nobody -print | xargs chown apache:apache xargs: unmatched single quote Any help is appreciated. Thanks in Advance. Guy |
Try running without the xargs and showing what find gives xargs.
Also try running without xargs. find has the ability to do the same thing with the -exec command info find "Actions" "Run Commands" "Single File" For more explenation of this really neat tool :) Find does a lot more then just finding files. |
I know your question was a long while back, but I just Googled for "xargs: unmatched single quote" and this was the top result, so I figured I'd add my $.02 here.
I was getting the same error, and found that my find command was returning filenames with single quotes (for example, "./mp3s/Rock/Ben Folds - Rockin' the Suburbs.mp3 "). This caused the unmatched single quote error in xargs. You could probably filter your find command through sed before xargs, but it's easier to use find -exec as teval suggests: $ find / -user nobody -group nobody -exec chown apache:apache "{}" \; where the files found are substitued for the braces, and the quotes around the braces will handle the odd single quote in a filename. Note that you end the -exec command with a semicolon, but escape it with a backslash to prevent the shell from seeing it as a separator. |
All times are GMT -5. The time now is 05:21 AM. |