how to run more than one command one terminal?
i 开发者_JAVA技巧have to run "for" loop on linux terminal itself how i can do.
ex.for i in cat ~/log
;do grep -l "UnoRuby" $i >> ~/logName; done.
Just as you typed it should be fine except: for i in $(cat ~/log); do grep -l "UnoRuby" $i >> ~/logName; done
You should prefer < instead of cat, and a more friendly format for the quesiton:
for i in $(< ~/log)
do
grep -l "UnoRuby" $i >> ~/logName
done
精彩评论