回答編集履歴

2

微修正

2019/02/06 02:47

投稿

otn
otn

スコア84555

test CHANGED
@@ -53,3 +53,5 @@
53
53
  Script done on Wed Feb 6 11:43:00 2019
54
54
 
55
55
  [user@host tmp]$
56
+
57
+ ```

1

追記

2019/02/06 02:47

投稿

otn
otn

スコア84555

test CHANGED
@@ -1 +1,55 @@
1
1
  バックスペースを適切に処理するのは、`col`に`-b`オプションを付ければいいです。
2
+
3
+
4
+
5
+ #追記
6
+
7
+ ```Bash
8
+
9
+ [user@host tmp]$ LANG=C script
10
+
11
+ Script started, file is typescript
12
+
13
+ [user@host tmp]$ echo hello world
14
+
15
+ hello world
16
+
17
+ [user@host tmp]$ exit
18
+
19
+ exit
20
+
21
+ Script done, file is typescript
22
+
23
+ [user@host tmp]$ cat -v typescript
24
+
25
+ Script started on Wed Feb 6 11:42:47 2019
26
+
27
+ [user@host tmp]$ echo hello wro^H ^H^H ^Horld^M
28
+
29
+ hello world^M
30
+
31
+ [user@host tmp]$ exit^M
32
+
33
+ exit^M
34
+
35
+
36
+
37
+ Script done on Wed Feb 6 11:43:00 2019
38
+
39
+ [user@host tmp]$ col -b < typescript | cat -v
40
+
41
+ Script started on Wed Feb 6 11:42:47 2019
42
+
43
+ [user@host tmp]$ echo hello world
44
+
45
+ hello world
46
+
47
+ [user@host tmp]$ exit
48
+
49
+ exit
50
+
51
+
52
+
53
+ Script done on Wed Feb 6 11:43:00 2019
54
+
55
+ [user@host tmp]$