Files
bash/bash-20060316/tests/misc/read-nchars-int.tests
T
2011-12-07 09:05:27 -05:00

12 lines
215 B
Plaintext

# 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