How can I insert a set of lines (about 5) into a file at the first place a string is found?
For example:
BestAnimals.txt
dog
cat
dolphin
cat
$ "Insert giraffe to BestAnimals.txt before cat" > NewBestAnimals.txt
NewBestAnimals.txt
dog
giraffe
cat
dolphin
cat
See Question&Answers more detail:os