Re: [問題] shell script的問題
※ 引述《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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 5 篇):