source:
trunk/essentials/app-shells/bash/tests/misc/read-nchars.tests
Last change on this file was 3228, checked in by , 18 years ago | |
---|---|
File size: 215 bytes |
Line | |
---|---|
1 | # interactive |
2 | |
3 | # from tty |
4 | read -n 3 -p 'enter three chars: ' xyz |
5 | echo |
6 | echo $xyz |
7 | |
8 | # using readline |
9 | read -p 'enter 3 chars: ' -e -n 3 abc |
10 | # readline outputs a newline for us, so we don't need the extra echo |
11 | echo $abc |
Note:
See TracBrowser
for help on using the repository browser.