Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In some shells (such as tcsh) it is a built-in command like "if" or "cd".


yeah, i wondered about that (in bash it's /bin/echo, fwiw - i looked).


Huh? /bin/echo is an executable, all shells should invoke that binary when given a path to it. In bash, echo is a builtin (it appears in the SHELL BUILTIN COMMANDS section of the man page between disown and enable).

  bash$ echo --help # the builtin
  --help
  bash$ /bin/echo --help # the executable
  Usage: /bin/echo [SHORT-OPTION]... [STRING]...
    or:  /bin/echo LONG-OPTION
  Echo the STRING(s) to standard output.
  (and a bunch of other GNU help text)


ah, ok. that makes sense. i just did "which echo" without thinking enough....


Try "type echo".

If "which" is not a builtin (which it isn't in bash, but is in zsh) then it can't tell you about builtins!




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: