0

Consider this example.

Twinkle Twinkle Little Star
How I wonder what you are
up above the world so high, 
like a diamond in the sky.....

I want to delete the words from you (in second line) to five dots (in fourth line)?

How do I do this in a shell script?

Another example:

The itsy bitsy spider crawled up the water spout.
Down came the rain, and washed the spider out.
Out came the sun, and dried up all the rain,
and the itsy bitsy spider went up the spout again

I want to delete the words from rain (in second line) to the comma character (in the third line after rain, NOT the comma in second line nor the one near the word sun).

  • 4
    Could you show us your attempt(s) at a solution? Stack Overflow is not a code-writing service. – Beta Apr 09 '21 at 02:47
  • This question probably belongs in the [how do I use regular expressions](https://regexone.com/) department – MyICQ Apr 09 '21 at 05:25
  • A good place to start could be the answers to [this question](https://stackoverflow.com/questions/1583219/how-to-do-a-recursive-find-replace-of-a-string-with-awk-or-sed) – Thomas Hansen Apr 09 '21 at 08:47

0 Answers0