Re: [問題] shell script的問題

看板Linux作者 (CA)時間16年前 (2009/05/04 03:25), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/5 (看更多)
※ 引述《derailed (nobody)》之銘言: : ※ 引述《wonder816 ( )》之銘言: : 先檢查找到的對不對 : cat a.txt | awk '{print "find . -name " $1 " -type d"}' | sh : 再來就砍掉吧 : cat a.txt | awk '{print "find . -name " $1 " -type d -delete"}' | sh : 有些系統的 find 好像不能 delete,那就 : cat a.txt | awk '{print "find . -name " $1 " -type d -exec rm -rf "}' : 或者 : cat a.txt | awk '{print "find . -name " $1 " -type d"}' | \ : awk '{print "rm -rf " $1}' for l in `cat /tmp/list.txt` ; do f="$f -not -name $l"; done ; \ find . $f -type d | xargs rm -rf ; f= ; l= ; 笨方法 XD -- 自High筆記(半荒廢) http://legnaleurc.blogspot.com/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.146.194.91
文章代碼(AID): #19_U-b-8 (Linux)
文章代碼(AID): #19_U-b-8 (Linux)