How do I pass Esc to stdin in shell, the Esc on a keyboard?
I have discovered that
On most keyboards, it can be entered as control[.
In a shell script, you could do this (which is part of the POSIX shell):
and in GNU echo, you may do
echo -e '\e'
Piping either to a script makes that the script's standard input ("stdin"):
printf '\033' | myscript