sed
command to delete everything and leave only words between pattern?
I tried:
$ sudo sed -i '/from/,/until/!d'
But it left some words under first line and it left whole lines not only words between patterns.
I have a file full of text but I only want to leave text between "from" text "until" and delete everything else.
I try
for file in `ls`
do
echo "`awk '/from/,/until/' $file`" > $file
done
and i have left two lines one is text from pattern above one is empty new line