Skip to main content
Commonmark migration
Source Link
  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

    Some commands have to be built into the shell program itself because they cannot work if they are external.

    cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  2. The other class of commands are built into the shell purely for efficiency.

    The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

    cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  2. The other class of commands are built into the shell purely for efficiency.

    The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

There are two classes of builtins:

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

Unix systems have always included separate executables for commands in that second class. These separate executables are still available on every Unixy system I've used, even though they're also built into every shell you're likely to use. (POSIX actually requires that these executables be present.)

I believe echo got built into the shell in AT&T Unix System V Release 3.1. I base that on comparisons of two different editions of manuals for AT&Ts 3B1 series Unix systems. Someone has kindly scanned 1986 editions of these manuals and put them online; these correspond to the original release of SVR3. You can see that echo isn't in the list on page 523 of UNIX System V User's Manual, Volume II, where you'd expect it if the command were built into the shell. In my local paper copy of the SVR3.1 manuals from 1987, echo is listed in this section of the manual.

I'm pretty sure this isn't a Berkeley CSRG innovation that AT&T brought back home. 4.3BSD came out the same year as SVR3, 1986, but if you look at 4.3BSD's sh.1 manpage, you see that echo is not in the "Special Commands" section's list of built-in commands. If CSRG did this, that leaves us wanting a documented source to prove it.

At this point, you may wonder if echo was built into the shell earlier than SVR3.1 and that this fact simply wasn't documented until then. The newest pre-SVR3 AT&T Unix source code available to me is in the PDP-11 System III tarball, wherein you will find the Bourne shell source code. You won't find echo in the builtin command table, which is in /usr/src/cmd/sh/msg.c. Based on the timestamps in that file, that proves that echo certainly wasn't in the shell in 1980.


Trivia

The same directory also contains a file called builtin.c which doesn't contain anything on-point for this question, but we do find this interesting comment:

/*      
    builtin commands are those that Bourne did not intend
    to be part of his shell.
    Redirection of i/o, or rather the lack of it, is still a
    problem..
*/      

There are two classes of builtins:

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

Unix systems have always included separate executables for commands in that second class. These separate executables are still available on every Unixy system I've used, even though they're also built into every shell you're likely to use. (POSIX actually requires that these executables be present.)

I believe echo got built into the shell in AT&T Unix System V Release 3.1. I base that on comparisons of two different editions of manuals for AT&Ts 3B1 series Unix systems. Someone has kindly scanned 1986 editions of these manuals and put them online; these correspond to the original release of SVR3. You can see that echo isn't in the list on page 523 of UNIX System V User's Manual, Volume II, where you'd expect it if the command were built into the shell. In my local paper copy of the SVR3.1 manuals from 1987, echo is listed in this section of the manual.

I'm pretty sure this isn't a Berkeley CSRG innovation that AT&T brought back home. 4.3BSD came out the same year as SVR3, 1986, but if you look at 4.3BSD's sh.1 manpage, you see that echo is not in the "Special Commands" section's list of built-in commands. If CSRG did this, that leaves us wanting a documented source to prove it.

At this point, you may wonder if echo was built into the shell earlier than SVR3.1 and that this fact simply wasn't documented until then. The newest pre-SVR3 AT&T Unix source code available to me is in the PDP-11 System III tarball, wherein you will find the Bourne shell source code. You won't find echo in the builtin command table, which is in /usr/src/cmd/sh/msg.c. Based on the timestamps in that file, that proves that echo certainly wasn't in the shell in 1980.


Trivia

The same directory also contains a file called builtin.c which doesn't contain anything on-point for this question, but we do find this interesting comment:

/*      
    builtin commands are those that Bourne did not intend
    to be part of his shell.
    Redirection of i/o, or rather the lack of it, is still a
    problem..
*/      

There are two classes of builtins:

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

Unix systems have always included separate executables for commands in that second class. These separate executables are still available on every Unixy system I've used, even though they're also built into every shell you're likely to use. (POSIX actually requires that these executables be present.)

I believe echo got built into the shell in AT&T Unix System V Release 3.1. I base that on comparisons of two different editions of manuals for AT&Ts 3B1 series Unix systems. Someone has kindly scanned 1986 editions of these manuals and put them online; these correspond to the original release of SVR3. You can see that echo isn't in the list on page 523 of UNIX System V User's Manual, Volume II, where you'd expect it if the command were built into the shell. In my local paper copy of the SVR3.1 manuals from 1987, echo is listed in this section of the manual.

I'm pretty sure this isn't a Berkeley CSRG innovation that AT&T brought back home. 4.3BSD came out the same year as SVR3, 1986, but if you look at 4.3BSD's sh.1 manpage, you see that echo is not in the "Special Commands" section's list of built-in commands. If CSRG did this, that leaves us wanting a documented source to prove it.

At this point, you may wonder if echo was built into the shell earlier than SVR3.1 and that this fact simply wasn't documented until then. The newest pre-SVR3 AT&T Unix source code available to me is in the PDP-11 System III tarball, wherein you will find the Bourne shell source code. You won't find echo in the builtin command table, which is in /usr/src/cmd/sh/msg.c. Based on the timestamps in that file, that proves that echo certainly wasn't in the shell in 1980.


Trivia

The same directory also contains a file called builtin.c which doesn't contain anything on-point for this question, but we do find this interesting comment:

/*      
    builtin commands are those that Bourne did not intend
    to be part of his shell.
    Redirection of i/o, or rather the lack of it, is still a
    problem..
*/      
added Sys III source code dive report; added trivia; removed pointless parenthetical
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
 

There are two classes of builtins:

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

Unix systems have always included separate executables for commands in that second class. These separate executables are still available on every Unixy system I've used, even though they're also built into every shell you're likely to use. (POSIX actually requires that these executables be present.)

I believe echo got built into the shell in AT&T Unix System V Release 3.1. I base that on comparisons of two different editions of manuals for AT&Ts 3B1 series Unix systems. Someone has kindly scanned 1986 editions of these manuals and put them online; these correspond to the original release of SVR3. You can see that echo isn't in the list on page 523 of UNIX System V User's Manual, Volume II, where you'd expect it if the command were built into the shell. In my local paper copy of the SVR3.1 manuals from 1987, echo is listed in this section of the manual.

I'm pretty sure this isn't a Berkeley CSRG innovation that AT&T brought back home. 4.3BSD came out the same year as SVR3, 1986. (SVR3.1 came out in 1987.) If, but if you look at 4.3BSD's sh.1 manpage, you see that echo is not in the "Special Commands" section's list of built-in commands. If CSRG did this, that leaves us wanting a documented source to prove it.

It is possible thatAt this point, you may wonder if echo gotwas built into the shell earlier than SVR3.1 and it wasthat this fact simply firstwasn't documented until then. The newest pre-SVR3 AT&T Unix source code available to me is in the SVR3PDP-11 System III tarball, wherein you will find the Bourne shell source code.1 manuals You won't find echo in the builtin command table, which is in /usr/src/cmd/sh/msg.c. Based on the timestamps in that file, that proves that echo certainly wasn't in the shell in 1980.


Trivia

The same directory also contains a file called builtin.c which doesn't contain anything on-point for this question, but we do find this interesting comment:

/*      
    builtin commands are those that Bourne did not intend
    to be part of his shell.
    Redirection of i/o, or rather the lack of it, is still a
    problem..
*/      

There are two classes of builtins:

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

Unix systems have always included separate executables for commands in that second class. These separate executables are still available on every Unixy system I've used, even though they're also built into every shell you're likely to use. (POSIX actually requires that these executables be present.)

I believe echo got built into the shell in AT&T Unix System V Release 3.1. I base that on comparisons of two different editions of manuals for AT&Ts 3B1 series Unix systems. Someone has kindly scanned 1986 editions of these manuals and put them online; these correspond to the original release of SVR3. You can see that echo isn't in the list on page 523 of UNIX System V User's Manual, Volume II, where you'd expect it if the command were built into the shell. In my local paper copy of the SVR3.1 manuals from 1987, echo is listed in this section of the manual.

I'm pretty sure this isn't a Berkeley CSRG innovation that AT&T brought back home. 4.3BSD came out the same year as SVR3, 1986. (SVR3.1 came out in 1987.) If you look at 4.3BSD's sh.1 manpage, you see that echo is not in the "Special Commands" section's list of built-in commands. If CSRG did this, that leaves us wanting a documented source to prove it.

It is possible that echo got built into the shell earlier than SVR3.1 and it was simply first documented in the SVR3.1 manuals.

 

There are two classes of builtins:

  1. Some commands have to be built into the shell program itself because they cannot work if they are external.

cd is one such since if it were external, it could only change its own directory; it couldn't affect the current working directory of the shell. (See also: Why is cd not a program?)

  1. The other class of commands are built into the shell purely for efficiency.

The dash man page has a section on builtins which mentions printf, echo, and test as examples of commands in this class.

Unix systems have always included separate executables for commands in that second class. These separate executables are still available on every Unixy system I've used, even though they're also built into every shell you're likely to use. (POSIX actually requires that these executables be present.)

I believe echo got built into the shell in AT&T Unix System V Release 3.1. I base that on comparisons of two different editions of manuals for AT&Ts 3B1 series Unix systems. Someone has kindly scanned 1986 editions of these manuals and put them online; these correspond to the original release of SVR3. You can see that echo isn't in the list on page 523 of UNIX System V User's Manual, Volume II, where you'd expect it if the command were built into the shell. In my local paper copy of the SVR3.1 manuals from 1987, echo is listed in this section of the manual.

I'm pretty sure this isn't a Berkeley CSRG innovation that AT&T brought back home. 4.3BSD came out the same year as SVR3, 1986, but if you look at 4.3BSD's sh.1 manpage, you see that echo is not in the "Special Commands" section's list of built-in commands. If CSRG did this, that leaves us wanting a documented source to prove it.

At this point, you may wonder if echo was built into the shell earlier than SVR3.1 and that this fact simply wasn't documented until then. The newest pre-SVR3 AT&T Unix source code available to me is in the PDP-11 System III tarball, wherein you will find the Bourne shell source code. You won't find echo in the builtin command table, which is in /usr/src/cmd/sh/msg.c. Based on the timestamps in that file, that proves that echo certainly wasn't in the shell in 1980.


Trivia

The same directory also contains a file called builtin.c which doesn't contain anything on-point for this question, but we do find this interesting comment:

/*      
    builtin commands are those that Bourne did not intend
    to be part of his shell.
    Redirection of i/o, or rather the lack of it, is still a
    problem..
*/      
found SVR3 manuals online, nailing down the introduction date of `echo` getting built-in
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading
ruled out BSD as source for making echo a built-in command
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading
added 13 characters in body
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading
added 70 characters in body; added 1 characters in body; added 50 characters in body; added 41 characters in body
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading
narrowed the time when echo got builtin to between 1982 and 1987; added 3 characters in body
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading
added Bourne tutorial link
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading
added 166 characters in body
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading
Source Link
Warren Young
  • 73.4k
  • 17
  • 182
  • 172
Loading