| ||||||
| 5/18 |
| 2004/7/30 [Computer/SW/Unix] UID:32593 Activity:high |
7/30 Ack! Too much politics! I have a technical question:
I have some files described by *.out and I want a nice scripty way to
trim the last line off of each of them. What's a good way to do this?
\_ sed. $d
\_ It would seem I'd need a pattern defining the last line for that
to be helpful.
\_ Erm. try it out. "sed '$d' filename"
\_ Thanks.
\_ foreach i ( `ls` )
mv $i `echo $i | sed s:.out::g`
end
Warning, this only works in csh.
\_ in that case, just do foreach i (*.out). |