[Gllug] perl script

Tethys tet at accucard.com
Thu Aug 22 09:36:25 UTC 2002


><pedant++>
>
>It is, but if /bin/echo is there (for other shells), the builtin is ignored..
>
> nickm at barnet:~$ strace echo hello
> execve("/bin/echo", ["echo", "hello"], [/* 21 vars */]) = 0
>
></pedant++>

To be really pedantic, I should point out that strace doesn't tell
you anything about whether the shell uses its builtin or /bin/echo.
What makes you think the shell runs /bin/echo if it's present? AFAIK,
the presence of echo in the path has no impact[1] on anything, and
the shell will use its builtin unless explicitly asked not to.

FYI, echo is builtin for at least bash, sh, ksh, pdksh, tcsh, zsh
and probably others.

Tet

[1] A few of the old timers out there may remember differently. My first
    Unix, 4.1BSD, used to change the behaviour of echo depending on
    $PATH. If /usr/ucb was earlier in the path than /usr/bin, then echo
    would use BSD semantics ("echo -n aaa"). Otherwise, it would use the
    AT&T behaviour ("echo aaa\c"). This was independent of which one you
    actually called (I can't remember if echo was builtin to the shell
    back then, but it definitely affected both of the filesystem versions
    of echo). Thus it was possible to call /usr/ucb/echo and get AT&T
    behaviour! Fortunately, this bug has long since been fixed...

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list