Posted by: Anonymous
[ip: 12.34.246.36]
on May 06, 2008 03:21 PM
Seems weird that the bash man page would list "echo" in the "SHELL BUILTIN" section, and that the binary would contain the echo usage statement, and that the "builtin" command would return true when executing "echo". ;)
0
user@host [/home/q0px]
$ bash -c 'builtin /bin/echo'; echo $?
bash: line 0: builtin: /bin/echo: not a shell builtin
1
As an aside, A big reason Linux used Bash instead of Korn was that ksh was not considered open source until recently. The AT&T license didn't allow it to be redistributed, or something like that. That's also why pdksh was developed. Recently, though, ksh93 was relicensed under the AT&T "cpl". If anything, it would have made more sense for Linux to use ksh if it was possible, since the POSIX sh specification was *very* strongly influenced by ksh88.
With regards to the difference between ksh93 and Bash - basically ksh has namespaces/compound variables and the ability to load compiled modules (I'm working on a module for shell-native LDAP support, for example), while Bash has the <<< "here variables" and better programmable completion. Ksh93 runs scripts faster than Bash, in general. Essentially, ksh (ksh93, not ksh88) is slightly more capable for script development, while bash is a little more handy as an interactive shell.
Re(1): Korn -- an extended shell
Posted by: Anonymous [ip: 12.34.246.36] on May 06, 2008 03:21 PMuser@host [/home/q0px]
$ strings `which bash` | grep -w echo
echo [-neE] [arg ...]
user@host [/home/q0px]
$ bash -c 'builtin echo'; echo $?
0
user@host [/home/q0px]
$ bash -c 'builtin /bin/echo'; echo $?
bash: line 0: builtin: /bin/echo: not a shell builtin
1
As an aside, A big reason Linux used Bash instead of Korn was that ksh was not considered open source until recently. The AT&T license didn't allow it to be redistributed, or something like that. That's also why pdksh was developed. Recently, though, ksh93 was relicensed under the AT&T "cpl". If anything, it would have made more sense for Linux to use ksh if it was possible, since the POSIX sh specification was *very* strongly influenced by ksh88.
With regards to the difference between ksh93 and Bash - basically ksh has namespaces/compound variables and the ability to load compiled modules (I'm working on a module for shell-native LDAP support, for example), while Bash has the <<< "here variables" and better programmable completion. Ksh93 runs scripts faster than Bash, in general. Essentially, ksh (ksh93, not ksh88) is slightly more capable for script development, while bash is a little more handy as an interactive shell.
#