LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-09-2004, 10:53 AM   #1
cbonar
Member
 
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54

Rep: Reputation: 16
error with find . | xargs


arrrghh !!!

I want to play all movies in all SUBdirectories of the current one.

So I tried :
Code:
find . | xargs mplayer
but it says (in french, although it's almost not understandable) :
Code:
xargs: Le paramètre simple n'est pas repérable par apostrophe.
which would approximately be (in english) :
Code:
xargs: The (bare?|simple?|unique?) parameter is not (locatable?) with quotes.

What did I make wrong ?

I also tried :
Code:
find . -mindepth 1 | xargs mplayer
so I don't have the "." entry, but I got the same error message...


-----------------

Here's a sample of the output of the former find . command (top and bottom) :
Code:
.
./dos
./dos/complet
./dos/complet/sweden-back-front.mpg
./dos/complet/jennie-50m-side2.mpg
./dos/complet/jennie-start.mpg
./dos/complet/laurentino.mpg
./dos/complet/oliveirapedro.mpg
./dos/complet/jennie-25m-side.mpg
./dos/complet/sweden-turn2-side.mpg
./dos/complet/jennie-front.mpg
./dos/complet/JensPetterson2.mpg
./dos/complet/JensPetterson3.mpg
./dos/complet/JensPetterson4.mpg
./dos/complet/JensPetterson5.mpg
./dos/backswim-men-stroke-side.mpg
./dos/Peirsol-stroke.mpg
./dos/Phelps-backstroke-under.mpg
./dos/lenny1.mpeg
./dos/lenny2.mpeg
./dos/MbackPiersolRecovery.mpeg
./dos/lenny3.mpeg
./dos/Peirsol-finishing.mpg
./dos/backstroke_07.jpg
./dos/Backswim-kayaking.mpg
./dos/Nina-golden-touch.mpg
./dos/Backstroke-SwimcityMediaCentre-NakamuraSilver&MocanuGoldOR100mSydney2000.mpg
./dos/welsh-bodyroll.mpg
./dos/depart
./dos/depart/backstart-men-good position.mpg
./dos/depart/Welsh-front.mpg

...

./brasse/Russian-women-breast-wide-knees-inward-sweep.mpg
./brasse/Poleska-style.mpg
./divers
./divers/Video-TestingTrolley.mpg
./divers/Story_400x320.mpg

Last edited by cbonar; 12-09-2004 at 11:20 AM.
 
Old 12-09-2004, 10:58 AM   #2
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
Maybe you want to try somthing like this? :

Code:
prompt> find . -name "*word_you_are_looking_for_here*" -print
or maybe even:

Code:
prompt> find . | grep word_you_are_looking_for_here
Hope that helps!
 
Old 12-09-2004, 11:02 AM   #3
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
Gosh, I'm sorry. I didn't even read all of your post.

I use mplayer to play all my movies like so:

Code:
prompt> mplayer *.mpeg *.avi *.mpg
It should be that simple. I do use extra options, so my actual line is more like:

Code:
prompt> mplayer -fs -loop 0 *.mpeg *.avi *.mpg
(great for pr0n...)
 
Old 12-09-2004, 11:09 AM   #4
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
Gee, I don't know what's wrong with me today. I misread your post _twice_.

Try this:

Code:
find . -print | grep .mpeg | xargs mplayer
The only reason, I can think of that this doesn't work is that your filenames or directories might contain spaces or quote characters...
 
Old 12-09-2004, 11:18 AM   #5
cbonar
Member
 
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54

Original Poster
Rep: Reputation: 16
Thanks for you 3 posts !!! LOL

but
Code:
find . -print | grep .mpg | xargs mplayer
behaves exactly the same...

The weird thing is that I've used this pattern (find . | xargs) for a long time, and it used to work...
I must miss some important thing, but I don't see which one...
 
Old 12-09-2004, 11:22 AM   #6
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
Maybe you can play around with xargs to try and feel it out? Maybe put the paths of a few movies in a file, and they do somthing like:

Code:
cat file_with_movie_paths_here | xargs
I think xargs defaults to echo, so this should give you the contents of the original file back.. Maybe if you play with it like this you can gain more insight into what is wrong?
 
Old 12-09-2004, 12:08 PM   #7
cbonar
Member
 
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54

Original Poster
Rep: Reputation: 16
Unhappy

Well, the problem seems to come from the maximum amount of chars (20K according to the man page) xargs can handle (what the error message doesn't lead to understand).

I'm still dubious about that, because :
  • find . | wc -m gives me 13379 characters, which is still under 20000 AFAIK
  • find . | xargs -s 50000 mplayer, which should allow xargs to handle up to 50K characters, gives me the exact same error



I think I'll have to fall back with a find . -exec mplayer "{}" \; which I don't like because I never remember the exact syntax, and furthermore it spans multiple successive mplayer instances, so I cannot stop the whole playlist by typing 'q' at mplayer...


Last edited by cbonar; 12-09-2004 at 12:30 PM.
 
Old 12-09-2004, 12:22 PM   #8
cbonar
Member
 
Registered: Apr 2004
Location: Paris, FRANCE
Distribution: Ubuntu
Posts: 54

Original Poster
Rep: Reputation: 16
Lightbulb

Ok, I've found another way to do it, less convenient, but easy to remember.
However, it should only work with mplayer since it uses its ability to read play lists.

Code:
find . > found
mplayer -playlist found
 
  


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
Several "find -exec" and "find | xargs" questions thanhvn Programming 4 12-02-2005 02:04 PM
du on specific files from find command (use xargs?) fireman949 Linux - Software 2 07-10-2005 02:42 AM
xargs and my own script harmster Linux - Software 4 05-07-2005 11:35 AM
xargs question reitzell Linux - Newbie 4 07-04-2004 03:36 AM
PHP: what's wrong with this line (shell_exec, find, xargs, grep)? J_Szucs Programming 3 11-19-2003 08:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration