i-bash/tests/misc/read-nchars.tests

12 lines
215 B
Text
Raw Normal View History

2000-03-17 21:46:59 +00:00
# interactive
# from tty
read -n 3 -p 'enter three chars: ' xyz
echo
echo $xyz
# using readline
read -p 'enter 3 chars: ' -e -n 3 abc
# readline outputs a newline for us, so we don't need the extra echo
echo $abc