LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-03-2003, 10:49 AM   #1
fillatre
LQ Newbie
 
Registered: Oct 2003
Posts: 1

Rep: Reputation: 0
Question 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
 
Old 10-03-2003, 05:49 PM   #2
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720

Rep: Reputation: 30
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.
 
Old 06-05-2004, 10:04 PM   #3
chazmati
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xargs: unmatched single quote akudewan Linux - Newbie 4 02-14-2005 05:48 AM
Double and single quote, Question in expect evilchild Programming 4 08-22-2004 05:34 PM
xargs question reitzell Linux - Newbie 4 07-04-2004 02:36 AM
LogWatch Cron :: Unmatched Entries elvisious Linux - Software 2 06-23-2004 07:10 AM
Strange problem (Unmatched Entries) 2HostMe Linux - Newbie 2 01-10-2004 08:32 AM


All times are GMT -5. The time now is 03:34 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration