Funny, I just did the exact same thing!

So far, the code is not providing much insight (but I'm not a C/C++
programmer!)... it does appear that the echo builtin is handled by the
same code as the print builtin. 

I've tried both strace and ltrace and not finding anything that jumps
out at me, although these lines from ltrace make me wonder just what in
the hell is going on (I have snipped lines between these):

strncmp("usr/kerberos/sbin:/usr/kerberos/"..., "usr/bin:", 8) = 9
strncmp("usr/kerberos/sbin:/usr/kerberos/"..., "ucb", 3) = 16
strncmp("usr/kerberos/bin:/usr/local/sbin"..., "usr/bin:", 8) = 9
strncmp("usr/kerberos/bin:/usr/local/sbin"..., "ucb", 3) = 16
strncmp("bin:/usr/local/sbin:/usr/local/b"..., "bsd", 3) = -10
strncmp("usr/local/sbin:/usr/local/bin:/s"..., "usr/bin:", 8) = 10
strncmp("usr/local/sbin:/usr/local/bin:/s"..., "ucb", 3) = 16
strncmp("usr/local/bin:/sbin:/bin:/usr/sb"..., "usr/bin:", 8) = 10
strncmp("usr/local/bin:/sbin:/bin:/usr/sb"..., "ucb", 3) = 16
strncmp("bin:/sbin:/bin:/usr/sbin:/usr/bi"..., "bsd", 3) = -10
strncmp("bin:/usr/sbin:/usr/bin:/root/bin"..., "bin:", 4) = 0

It would appear that some behaviour would be different depending on
whether you have certain things in your PATH.

Still looking through the code.

Kevin

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tom Sightler
Sent: Friday, July 06, 2007 10:57 AM
To: Red Hat Enterprise Linux 5 (Tikanga) discussion mailing-list
Subject: Re: [rhelv5-list] how to handle "echo" ?

On Fri, 2007-07-06 at 12:03 -0500, inode0 wrote:
> I tried yesterday with /bin as the first thing in PATH and it didn't
> appear to look for an external echo anywhere.

Your right, it seems to follow the path until it gets to /bin and then
stops, even if it doesn't find echo there.  I removed echo from my /bin
directory but it never pursues any directories in the PATH after /bin,
only the ones before /bin.  Seems strange.

> It will be interesting to hear what the code is actually doing.

I agree.

Later,
Tom


_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to