LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux > 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
 
Thread Tools
Old 10-03-2003, 11:49 AM   #1
fillatre
LQ Newbie
 
Registered: Oct 2003
Posts: 1
Thanked: 0
Question xargs: unmatched single quote


[Log in to get rid of this advertisement]
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
fillatre is offline     Reply With Quote
Old 10-03-2003, 06:49 PM   #2
teval
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Gentoo
Posts: 720
Thanked: 0
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.
teval is offline     Reply With Quote
Old 06-05-2004, 11:04 PM   #3
chazmati
LQ Newbie
 
Registered: Aug 2003
Posts: 4
Thanked: 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.
chazmati is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 06:48 AM
Double and single quote, Question in expect evilchild Programming 4 08-22-2004 06:34 PM
xargs question reitzell Linux - Newbie 4 07-04-2004 03:36 AM
LogWatch Cron :: Unmatched Entries elvisious Linux - Software 2 06-23-2004 08:10 AM
Strange problem (Unmatched Entries) 2HostMe Linux - Newbie 2 01-10-2004 09:32 AM


All times are GMT -5. The time now is 07:57 PM.

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration