I'm looking for a solution to a smple variant to this tail question...hoping someone will know the solution. Basically I want to tail
a file until a string/pattern is matched and then write the contents out from the end of the file up until the line containing that pattern (or up to that pattern). The solution at this link, with a slight modification to re-direct output to a new file:
sh -c 'tail -n +0 --pid=$$ -f tmp.log | { sed "/pattern/ q" && kill $$ ;}' >& tmp.txt
gave me the exact opposite (contains the file from the top upto the string/pattern match). Appreciate any ideas - thanks for your time.