SA HWK3 shell script 1) 請用一行指令完成此小題作業要求 在某一個目錄下,用 command line 下一指令,而此指令可將此 目錄底下內所有副檔名為 JPG | JPg | Jpg | JpG ... 之檔案都 改為小寫的副檔名 (jpg), 注意: 子目錄裡面之檔案要也達到此要求。 2) monitor 自己的 blog (若沒有 blog 者,請自己申請一個,或自己架一個) ,寫一個 shell script 程式, 此程式能定期到此 blog 上查看是否有新 文章,如果有便會寄一封 mail 到指定的信箱 (寫死在程式內,或改為參數 型式皆可),而內容為此新文章的 url 及此篇新文章的 title。(寄整個文章 的 content 到 mail 裡,不包含 html tag,只含文章內容純文字部份,為 加分項目) 3) 寫一隻 shell script 程式去 parse auth.log auth.log 的範列下載,你也能在 /var/log/auth.log 找到一些例子。 而此程式需達 到下列要求 執行方式為 fileName.sh [-s ip|success|fail] [-r] [-v] [inputFile] 其中參數功能如下: -s 後面可分別接三種不同的參數: ip, success, fail,意思分別為 sort by ip, sort by success times, and sort by fail times。而當 command 沒接 -s 參數時,default 為 sort by ip -r 表示為 reverse sort,也就是由小排到大,沒接 -r 時為由大排到小 -v 接此參數時,會使得些程式 output format 如下 # statistic -- ip success_times fail_times 140.113.x.x 100 20 140.113.y.y 107 5 ... # bad lst 140.113.x.x ... # success_time intersect with bad list chwong chiahung ... 而當沒接些參數時,default output 只有 bad list 那一項 inputFile 為 auth.log,若沒接 input file 表示為 stdin *** 繳交方式 *** 於 11/29 23:59:59 前 mail to hwk3@sabsd.cs.nctu.edu.tw 1) subject 為 "SA-HWK3 學號 姓名 系級" 2) 程式為附檔 3) 從自己安裝的 FreeBSD 寄信 違者扣分 !!!