(動画教材準備中)
distribute : 標準出力を1行ずつファイルに振り分ける
Usage : distribute [-a] <file1>
Version : Tue Jun 10 23:34:46 JST 2014
オプションで指定したファイルに、標準入力の中身を一行ずつ振り分けていきます。
-a オプション指定時は追記モードで振り分けします。
$ cat data
1 a
2 b
3 c
4 d
5 e
6 f
7 g
8 h
9 i
10 j
$ distribute file1 file2 file3 < data $ cat file1
1 a
4 d
7 g
10 j
$ cat file2
2 b
5 e
8 h
$ cat file3
3 c
6 f
9 i
例2
-a オプションをつけると追記になります。
$ distribute -a file1 file2 file3 < data
$ cat file1
1 a
4 d
7 g
10 j
1 a <-- 追記される
4 d
7 g
10 j
ファイル名 "-" のファイルは使えません。