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

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!




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

Search: