BASH - How to retrieve rows from a file from #SOF to #EOF

Posted by Charlie on Stack Overflow See other posts from Stack Overflow or by Charlie
Published on 2012-12-09T18:50:29Z Indexed on 2012/12/09 23:04 UTC
Read the original article Hit count: 262

Filed under:

How to retrieve rows from a file from #SOF to #EOF

in source.sh
#SOF
"Lorem ipsum dolor sit amet"
"Vivamus pretium enim"
"Est accumsan enim magnis"
#EOF

#SOF
"Eleifend tincidunt id justo"
"Tellus ut tincidunt vel ac a orci"
"Sapien Nullam Sed nunc"
"Vestibulum est accumsan enim"
#EOF

#SOF
"Consequat mauris mollis montes"
#EOF

I need to get 3 files

in target_1.sh
"Lorem ipsum dolor sit amet"
"Vivamus pretium enim"
"Est accumsan enim magnis"

in target_2.sh
"Eleifend tincidunt id justo"
"Tellus ut tincidunt vel ac a orci"
"Sapien Nullam Sed nunc"
"Vestibulum est accumsan enim"

in target_3.sh
"Consequat mauris mollis montes"

Tell someone how to do it? thank you for your help

© Stack Overflow or respective owner

Related posts about bash