Reputation: 1125
i 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.
Upvotes: 0
Views: 668
Reputation: 36229
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
Upvotes: 0
Reputation: 38412
Just as you typed it should be fine except: for i in $(cat ~/log); do grep -l "UnoRuby" $i >> ~/logName; done
Upvotes: 1