"grep" not working

Bill Campbell linux-sxs
Thu May 17 09:30:18 PDT 2007


On Thu, May 17, 2007, Dirk Moolman wrote:
>Ok, I found the problem.   David was on the right track, regarding the
>binary which could be different.
>
>I found this out another way, by printing out root's profile, and the
>user's profile, and sitting and comparing the 2 profiles.   I first
>thought this might be related to the locale or language settings, but it
>wasn't.

That seems to be the hard way to compare them:

# as user
env | sort > /tmp/envuser
su - root
env | sort > /tmp/envroot
exit
diff -u /tmp/envuser /tmp/envroot

>I then got desperate, and changed her PATH settings, and viola, it
>worked. I then ran a find, to look for another file with the name grep.
>Interesting enough, the which & type commands, showed the correct binary
>(in /usr/bin), but the find command showed me another file, sitting in
>the directory she was working in.

This is why the local directory '.' should *NEVER* be in one's PATH!

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software, LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

"If taxation without consent is robbery, the United States government
has never had, has not now, and is never likely to have, a single honest
dollar in its treasury." -- Lysander Spooner, Letter to Grover Cleveland 1886



More information about the Linux-users mailing list