【发布时间】:2011-12-18 11:24:55
【问题描述】:
需要有关 while 命令的帮助。如果 playlist.txt 中有 $sitename,我想运行命令
这是我的狂欢:
cat playlist.txt | grep -e "$sitename" | sed -e "s/^.*\(http:.*"$sitename".*flv\).*$/\1/g" | sort | uniq > checklist.txt
cat checklist.txt
while [ " While can find $sitename in checklist.txt" ]; do
qa
done
这就是我已经尝试过的
while [ -n "$echopl" ]; do
qa
done
while [ 'grep -q $string checklist.txt >/dev/null' ]; do
qa
done
while [ "grep -q "$string" checklist.txt" ]; do
qa2
done
while grep -q "$string" checklist.txt; do
qa
done
while grep -q '$string' checklist.txt; do
qa
done
if grep -q "$string" checklist.txt ; then
qa
fi
我暂时放了很多 if 命令 :(
ifmorelinks ifmorelinks ifmorelinks ifmorelinks ifmorelinks
【问题讨论】:
标签: linux bash while-loop debian