-
Notifications
You must be signed in to change notification settings - Fork 1
/
expand.1
93 lines (63 loc) · 2.98 KB
/
expand.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
EXPAND(1) Human68k ITA TOOLBOX User's Manual EXPAND(1)
名称
expand - 水平タブをスペースに置き換える
形式
expand [ -iBCZ ] [ -t tab[,...] ] [ -tab[,...] ] [ -- ]
[ file ] ...
解説
expand は各 file を順次読み取り,水平タブをスペースの並びに
置き換えて標準出力に出力します.バックスペース(^H)と復帰
(^M)による桁の後退は考慮されます.
file が 1つも指定されていない場合,または file が‘-’である
場合には標準入力から読み取りを行います.file がオープンでき
ないときにはエラー・メッセージを標準エラー出力に出力して処理
を継続します.
tab はタブストップの位置です(行の先頭は 0).tab には 1 以
上の数値を指定してください.
tab は,-8 のように - に続けて直接記述することもできますし,
-t8 または -t 8 のように -t オプションの引数として指定するこ
ともできます.
tab を複数指定すると,それぞれの桁がタブストップとなります.
最後のタブストップを越えた位置に現れるタブはすべて 1個のスペー
スに置き換えられます.tab を 1つだけ指定すると,その整数倍に
あたる位置がすべてタブストップとなります.tab を 1つも指定し
ないと,デフォルトとして 8 の整数倍にあたる位置がすべてタブ
ストップとなります.
tab を複数指定する場合,たとえば -5 -10 -20 のように指定する
代わりに -5,10,20 のように指定することもできます.-t オプショ
ンを使用する場合も同様です.いずれにしても数値の小さい順に指
定しなければなりません.
expand には次のオプションがあります.
-i 行頭の水平タブの並びのみを変換します.
-B 決して ^J コードの ^M^J への変換を行いません.通常は,
出力が cooked モードのキャラクタ・デバイス(CON や PRN
など)である場合には,^M に続いていない ^J コードを
^M^J に変換して出力します.
-C -B オプションと逆に,^M に続いていない ^J コードを常に
^M^J に変換して出力します.
-Z いかなる入力からも,^Z (control-Z) コードを EOF と見な
して入力を打ち切ります.通常は,入力が cooked モードの
キャラクタ・デバイス(CON など)である場合にのみ,^D か
または ^Z を読み取ると,それを EOF コードと見なして入力
を打ち切ります.
関連事項
unexpand(1)
診断
何らかのエラーがあったときにはエラー・メッセージが標準エラー
出力に出力されます.
終了ステータスとしては,引数の記述に間違いがあった場合には 1,
ファイルがオープンできなかったり入力に失敗した場合には 2,出
力エラーやメモリ不足など,システムの問題により正常に実行でき
なかった場合には 3,すべてが正常に終了したならば 0 が返りま
す.^C などによって中断したときの終了ステータスは OS の仕様
によります.
不具合
expand は,復帰,改行,バックスペース,水平タブを除く文字は
すべて 1バイトあたり 1桁を占めるものとして桁を数えています.
一般的なシフトJISテキストにはこれで対応できますが,2バイト半
角文字などの特殊な文字には対応していません.
バージョン
1.0
制作・著作
Copyright(C)1993 by 板垣 史彦 (Itagaki Fumihiko)
1.0 Last change: 26 Dec 1993 Itagaki Fumihiko