for i in file-*.log
do
sed -n '0,/DONE/!p' $i > ${i/file/new}
done
"!" tells it to ignore everything from the start of the file "0" to the first line containing the keyword "/DONE/", then p makes it print the rest, with a shell redirection of the output to a new file.
Regards to David the H. at LinuxQuestions for pointing this out to me.
Keine Kommentare:
Kommentar veröffentlichen