echo
是 bash 内置的。是否有一个外部命令可以做同样的事情echo
? (可以做更多)
答案1
有echo
:
$ /bin/echo --version
echo (GNU coreutils) 8.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Brian Fox and Chet Ramey.
不改变 shell 状态的 Shell 内置命令也通常作为外部命令实现 - [
/test
是一个著名的命令,因此printf
:
$ /bin/printf --version
printf (GNU coreutils) 8.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
如果有的话busybox
,它也可能支持echo
:
$ busybox echo --version
--version