有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.
Run Code Online (Sandbox Code Playgroud)
不改变 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.
Run Code Online (Sandbox Code Playgroud)
如果有busybox
,它也可能支持echo
:
$ busybox echo --version
--version
Run Code Online (Sandbox Code Playgroud)