On Mon, 2013-11-04 at 17:08 -0800, David White wrote:
> Busy Box is installed on my Android phone and provides grep and pgrep
> on my device. And I note what seems to be an issue. If you look at the
> terminal output in the attached screen shot it appears the both pgrep
> and ps | grep are matching patterns incorrectly. The pattern is X*vnc
> and while this should indeed match the first process shown, I don't
> understand why it is matching the other two (which lack an X or even
> an x in their names).
> 
> So maybe this is a problem in BusyBox?

No.  The grep operations operate on regular expressions (hence the "re"
in their name), not on file globbing expressions.

In file globbing, "X*vnc" means the character X, followed by zero or
more characters, followed by "vnc".

In regular expressions, "X*vnc" means zero or more X characters,
followed by "vnc".

If you want the equivalent of that file globbing expression as a regular
expression you need to use "X.*vnc", which means the character X,
followed by zero or more (*) of any character (.), followed by "vnc".

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to