On most keyboards it can be entered as control [.
In a shell script, you can do this (this is part of the POSIX shell):
printf '\033'
and in GNU echo
you can do
echo -e '\e'
Piping to the script makes the script's standard input ("stdin"):
printf '\033' | myscript
source
to share