| Author |
Message |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: Wed 21 Dec 2011, 03:36 Post subject:
Simple "find" command problem. |
|
I downloaded 6 missing libraries for ffmpeg and wanted to undeb all of them.
Tried these commands as find`s help said, both errored the same:
| Code: | sh-4.1# find /mnt/sdb3/deb_bin/ffmpeg_i386 -name lib*.deb -exec undeb
find: missing argument to `-exec'
sh-4.1# find /mnt/sdb3/deb_bin/ffmpeg_i386 -name lib*.deb -exec undeb {}
find: missing argument to `-exec' |
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2422
|
Posted: Wed 21 Dec 2011, 04:00 Post subject:
|
|
Is it finding libs to undeb?
| Code: |
sh-4.1# find /mnt/sdb3/deb_bin/ffmpeg_i386 -name lib*.deb
|
edit: Yeah.... -exec doesn't seem to work
| xargs [command] works
Last edited by jpeps on Wed 21 Dec 2011, 04:19; edited 2 times in total
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2422
|
Posted: Wed 21 Dec 2011, 04:01 Post subject:
|
|
duplicate post
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Wed 21 Dec 2011, 04:33 Post subject:
|
|
| Code: | for x in `find ...`;do
somethingto $x
done |
replace the ... with whatever finds your files
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2689 Location: Kiel,Germany
|
Posted: Wed 21 Dec 2011, 08:32 Post subject:
|
|
| Quote: | | find /mnt/sdb3/deb_bin/ffmpeg_i386 -name lib*.deb -exec undeb {} |
| Code: | | find /mnt/sdb3/deb_bin/ffmpeg_i386 -name lib*.deb -exec undeb {} \; -exec echo {} \; -exec ls -l {} \; |
I know from amigo .
I read on the net also to '{}' single quote or doubble quote the curved brackets .
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2422
|
Posted: Wed 21 Dec 2011, 12:30 Post subject:
|
|
Strange---nothing worked yesterday re "-exec", today everything works..quoted or non-quoted.
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Wed 21 Dec 2011, 13:21 Post subject:
|
|
The error in the OP is that it needs either a \; or a \+ at the end of the -exec argument (as well as the {}). That's how find knows where the end is. The difference between \; and \+ is that with \; it runs the command once per find, whereas with \+ it combines the results into one command.
| Code: | find /mnt/sdb3/deb_bin/ffmpeg_i386 -name lib\*.deb -exec undeb {} \;
#equivalent to:
undeb /mnt/sdb3/deb_bin/ffmpeg_i386/libCooper.deb
undeb /mnt/sdb3/deb_bin/ffmpeg_i386/libMarla.deb
undeb /mnt/sdb3/deb_bin/ffmpeg_i386/libStuart.deb
undeb /mnt/sdb3/deb_bin/ffmpeg_i386/libVal.deb
|
| Code: | find /mnt/sdb3/deb_bin/ffmpeg_i386 -name lib\*.deb -exec undeb {} \+
#equivalent to:
undeb /mnt/sdb3/deb_bin/ffmpeg_i386/libCooper.deb /mnt/sdb3/deb_bin/ffmpeg_i386/libMarla.deb /mnt/sdb3/deb_bin/ffmpeg_i386/libStuart.deb /mnt/sdb3/deb_bin/ffmpeg_i386/libVal.deb |
Also, it's a good idea to escape or quote name arguments that have asterisks, so that the shell doesn't try to expand them before sending them to find. Otherwise if you have any files in the local directory that match the name pattern, your name option will be expanded into them before being sent to find, which is probably not what you want.
The code technosaurus posted will work as long as the filenames don't have spaces in them. If there are spaces, it is better to use the -exec argument of find. Using -exec with the \+ can also be more efficient than a for loop, depending on what you're doing.
_________________ Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: Wed 21 Dec 2011, 17:39 Post subject:
|
|
Thanks everyone...
Pizzasgood; I seem to recall ( I think ) amigo telling me this awhile back.
Note: I thought once I tried multiple files with undeb and it didn`t work.
# I see you`re a fan of Dune Pizzasgood. The original or the remake?
Added it to my code snips.
The code snips file is getting pretty long, time for a snips/clips manager.
|
|
Back to top
|
|
 |
Pizzasgood

Joined: 04 May 2005 Posts: 6270 Location: Knoxville, TN, USA
|
Posted: Mon 26 Dec 2011, 13:22 Post subject:
|
|
I don't think I've ever tried undeb on multiple files.
I'm a fan of the books. Haven't gotten around to watching the movie yet. It's on my list of movies to watch sometime.
_________________ Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: Mon 26 Dec 2011, 15:18 Post subject:
|
|
The original with Kyle MacLaughlin is my favorite, but hard to find.
The remakes; Dune, and Children of Dune are very good also.
|
|
Back to top
|
|
 |
|