Script x-3

# ----------------------------------------------- # Script x-3: txt2htm # 將所有的 *.txt 檔的副檔名改成 htm # -----------------------------------------------
ls *.txt | sed 's/.txt//' | while read name do mv $name.txt $name.htm done

 
   
Script x-4

# ----------------------------------------------- # Script x-4: # 將一批資料檔 餵給 一個 R script 執行 # test.h # # m <- read.csv ("FILE") # # -----------------------------------------------
for i in *csv do echo ============ $i =============== sed "s/FILE/$i/" test.h > test.R Rscript test.R done > output.txt