Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 3
    Also, a command that's a program in one implementation of *nix might well become a shell builtin (= function) in another. Commented Sep 13, 2018 at 15:14
  • 1
    @jamesqf, yeah, shell's have standard tools built in, but builtin commands are not the same as functions. Run e.g. sh -c 'type true; f() { echo x; }; type f' Commented Sep 13, 2018 at 17:16
  • 5
    Note that in general, type is preferable to which for almost all purposes. See unix.stackexchange.com/q/85249/135943 Commented Sep 13, 2018 at 18:00
  • @ilkkachu: That depends on your definition of "the same as". Of course they are implemented differently, but to the ordinary user typing a command, they are functionally the same. Commented Sep 14, 2018 at 17:05
  • 1
    @jamesqf, even if your ordinary user doesn't (know how to) use functions, claiming they're the same as builtins is just confusing. Commented Sep 14, 2018 at 18:46