shell寫法 - Linux

Table of Contents


請問一下
我有一個檔案
需要每四行 就切開輸出各個文件
指令是這樣下的
split -l 行數 file output

但產生的文件 會從outputaa.....outputzz

我需要檔名 就是四行中的第一行 當作檔名
請問 要怎樣修改指令
謝謝

--




--

All Comments

Todd Johnson avatarTodd Johnson2011-12-31
for f in *; do read line <$f; mv $f $line; done