ps and grep problem

Hi,
Has anyone had any problems with grep in OS X (Tiger)? I usually go into Terminal and kill apps. I've noticed that grep acts differently than in usual Linux/Unix distro. If I do this, I get nothing:

ps aux | grep -i firefox

I know that Firefox is running, and it should return with process info. But if I change the command to this:

ps aux | grep irefox

I get the process info. Strange? Anyone know why? :confused:

-Nitin

That's very odd. On my Leopard OSX box, "grep" works exactly as I would expect (that is, "-i" causes it to ignore case).

I don't use Firefox so I can't check, but I would suspect that the "F" in "Firefox" is not really a capital letter "f". If it were, then the pattern would have matched. Maybe it's from an extended character set?

I would dump the "ps aux" output to a file and then verify that the letters are actually what they appear to be and there are no hidden bytes. You might even dump the file through the "hexdump" filter to make sure that an F is still an F.

`ps aux` does not output either "firefox" or "Firefox" on an 80 character xterm or Terminal. Unless you include a 'w' option or widen the window then it won't work. Below is a sample output with an 80 char screen and another with a 170 wide screen:

sh-2.05b$ ps aux |grep firefox
sh-2.05b$

Now with 170 char wide

sh-2.05b$ ps aux |grep firefox
crichmon 20611 3.0 21.7 1301024 284200 ?? Ss Sun03PM 666:48.92 /Applications/Firefox.app/Contents/MacOS/firefox-bin -foreground
crichmon 24064 0.0 0.0 27368 444 p5 S+ 10:44AM 0:00.00 grep firefox

Then 80 char term but with the 'w':

sh-2.05b$ ps auxw |grep firefox
crichmon 20611 3.2 21.7 1301624 284800 ?? Ss Sun03PM 666:51.70 /Applications/Firefox.app/Contents/MacOS/firefox-bin -foregrou
crichmon 24066 0.0 0.0 18060 260 p5 R+ 10:45AM 0:00.00 grep firefox
sh-2.05b$