Issue
How could I rewrite echo
to print some character before anything I pass to it?
I was thinking about something like this which does not work:
alias oldecho=echo
echo(){oldecho ==> $1}
Solution
Close.
echo() { builtin echo "==>" "$@"; }
builtin
forces the rest of the command to be executed as a builtin, which simplifies reimplementing builtins.
Your problem, though, was not quoting the >
.
Answered By - rici Answer Checked By - David Goodson (WPSolving Volunteer)