$ values=( 300 400 )
$ echo "scale=20; $values[1]-$values[2]" | bc
(standard_in) 1: illegal character: ^M // Why does it not print -100?
$ echo $values // no ^M sign found!
300 400
[Update]
- Why is
5E 4d 0a
, ie^M
, 13th char in ASCII? - Why is the ending sign
0a
shown as.
?.
is2E
in DEC. Hex number5E
is94
in DEC,4d
is77
in DEC.
ASCII and ^M
$ echo "^M" | hexdump -C
00000000 5e 4d 0a |^M.|
00000003
$ ascii -x
0 NUL 10 DLE 20 30 0 40 @ 50 P 60 ` 70 p
1 SOH 11 DC1 21 ! 31 1 41 A 51 Q 61 a 71 q
2 STX 12 DC2 22 " 32 2 42 B 52 R 62 b 72 r
3 ETX 13 DC3 23 # 33 3 43 C 53 S 63 c 73 s
4 EOT 14 DC4 24 $ 34 4 44 D 54 T 64 d 74 t
5 ENQ 15 NAK 25 % 35 5 45 E 55 U 65 e 75 u
6 ACK 16 SYN 26 & 36 6 46 F 56 V 66 f 76 v
7 BEL 17 ETB 27 ' 37 7 47 G 57 W 67 g 77 w
8 BS 18 CAN 28 ( 38 8 48 H 58 X 68 h 78 x
9 HT 19 EM 29 ) 39 9 49 I 59 Y 69 i 79 y
A LF 1A SUB 2A * 3A : 4A J 5A Z 6A j 7A z
B VT 1B ESC 2B + 3B ; 4B K 5B [ 6B k 7B {
C FF 1C FS 2C , 3C < 4C L 5C \ 6C l 7C |
D CR 1D GS 2D - 3D = 4D M 5D ] 6D m 7D }
E SO 1E RS 2E . 3E > 4E N 5E ^ 6E n 7E ~
F SI 1F US 2F / 3F ? 4F O 5F _ 6F o 7F DEL