read echo >$2 不懂
(http://www.linuxsir.org/main/doc/abs/HTML/special-chars.html)
Ctl-M
Carriage return.
1 #!/bin/bash
2 # Thank you, Lee Maschmeyer, for this example.
3
4 read -n 1 -s -p $'Control-M leaves cursor at beginning of this line. Press Enter. \x0d'
5 # Of course, '0d' is the hex equivalent of Control-M.
6 echo >&2 # The '-s' makes anything typed silent,
7 #+ so it is necessary to go to new line explicitly.
8
9 read -n 1 -s -p $'Control-J leaves cursor on next line. \x0a'
10 # '0a' is the hex equivalent of Control-J, linefeed.
11 echo >&2
12
13 ###
14
15 read -n 1 -s -p $'And Control-K\x0bgoes straight down.'
16 echo >&2 # Control-K is vertical tab.
17
18 # A better example of the effect of a vertical tab is:
19
20 var=$'\x0aThis is the bottom line\x0bThis is the top line\x0a'
21 echo "$var"
22 # This works the same way as the above example. However:
23 echo "$var" | col
24 # This causes the right end of the line to be higher than the left end.
25 # It also explains why we started and ended with a line feed --
26 #+ to avoid a garbled screen.
27
28 # As Lee Maschmeyer explains:
29 # --------------------------
30 # In the [first vertical tab example] . . . the vertical tab
31 #+ makes the printing go straight down without a carriage return.
32 # This is true only on devices, such as the Linux console,
33 #+ that can't go "backward."
34 # The real purpose of VT is to go straight UP, not down.
35 # It can be used to print superscripts on a printer.
36 # The col utility can be used to emulate the proper behavior of VT.
37
38 exit 0