echo
is bash builtin. Is there an external command which can do the same thing as echo
? (may do more)
Asked
Active
Viewed 76 times
1

Gilles 'SO- stop being evil'
- 829,060

Tim
- 101,790
1 Answers
5
There's 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 builtins which don't change the state of the shell are also often implemented as external commands - [
/test
is a famous one, so is 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.
If you have busybox
, it is also likely to support echo
:
$ busybox echo --version
--version

muru
- 72,889
-
Thanks. What are the differences between the two, in purposes and in ways for usage? – Tim Mar 04 '16 at 20:15
-
@Tim No difference in purpose. They may accept different flags - check the manpage on your system to know for sure. – muru Mar 04 '16 at 20:16
-
How do you invoke
echo
as an external command? Full path? (can it be less complex?) – Tim Mar 04 '16 at 20:17 -
@Tim try some of the methods given in http://unix.stackexchange.com/q/86266/70524 – muru Mar 04 '16 at 20:20
printf(1)
might also be handy for some needs. – thrig Mar 04 '16 at 20:59