Reply
Thread Tools
ME2g's Avatar
Posts: 168 | Thanked: 58 times | Joined on Aug 2010 @ Vienna
#1
I am using Maemo 5, Version 10.2010.19-1 on N900.

When doing a
find . -type f -exec grep "somthing" {} \;
then I get an error message
"find: unrecognized: -exec"

Is the find command different on ash?
Documentation says that it is the same.
 
Posts: 2,829 | Thanked: 1,459 times | Joined on Dec 2009 @ Finland
#2
btw. itīs not bash (you can install it) itīs busybox and also you can install find separately IIRC.
 

The Following User Says Thank You to slender For This Useful Post:
Posts: 486 | Thanked: 251 times | Joined on Oct 2009
#3
Originally Posted by ME2g View Post
I am using Maemo 5, Version 10.2010.19-1 on N900.

When doing a
find . -type f -exec grep "somthing" {} \;
then I get an error message
"find: unrecognized: -exec"

Is the find command different on ash?
Documentation says that it is the same.
On the n900, find is provided by busybox, which likely does not provide the -exec option to find.
__________________
The Mini-USB plug is an improvement over both the Type B plug and the Micro-B plug.
 

The Following 2 Users Say Thank You to j.s For This Useful Post:
Posts: 540 | Thanked: 387 times | Joined on May 2009
#4
The N900 comes with busybox. Busybox doesn't use the GNU coreutils utilities/commands instead it has watered downed versions with less features. BASH vs ASH is mostly syntax related.

Install this: http://maemo.org/packages/view/coreutils-gnu/
Or simply compile coreutils in scratchbox yourself and copy over the binary find command.

Woops find is not part of coreutils but instead findutils.

Last edited by linuxeventually; 2010-09-14 at 23:02.
 

The Following User Says Thank You to linuxeventually For This Useful Post:
ME2g's Avatar
Posts: 168 | Thanked: 58 times | Joined on Aug 2010 @ Vienna
#5
Thanks.

Does "findutils-gnu v4.4.2-1maemo7"
http://maemo.org/downloads/product/M...findutils-gnu/
also do the trick?
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#6
That's probably why they put xargs in findutils.

busybox find + xargs = good
__________________
N9: Go white or go home
 

The Following User Says Thank You to daperl For This Useful Post:
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#7
Originally Posted by daperl View Post
That's probably why they put xargs in findutils.
Indeed, piping to xargs is generally a much better option than -exec.

busybox find + xargs = good
I think you'll find it's not, the Maemo busybox is configured with support for find -print0 but not xargs -0 :-(
 

The Following User Says Thank You to lma For This Useful Post:
Posts: 303 | Thanked: 175 times | Joined on Oct 2009 @ London UK
#8
Xargs is nice.. but... Shell is pretty versatile

Code:
find / -some-options | while IFS="" read file ; do echo "Found file: $file" ; done
Remember to enclose "$file" in double-quotes..
 

The Following 4 Users Say Thank You to cpitchford For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#9
Originally Posted by lma View Post
I think you'll find it's not, the Maemo busybox is configured with support for find -print0 but not xargs -0 :-(
So true, but lucky me, I have yet to come across an n900 file name of interest that has spaces or newlines.
__________________
N9: Go white or go home
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#10
Originally Posted by cpitchford View Post
Xargs is nice.. but... Shell is pretty versatile
True, and even a read loop is going to be faster than -exec anyway (though a bit more verbose to type). For anything more advanced one can always pull out File::Find.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 09:15.