Addressing one aspect of your (now original) question.
(And your new questions stills talks about grep and -A1 and pretends that you can't find a way to specify 3 hiphens and that's just wrong because in your comments you've shown that you can).
[your original question asked how to show results FROM a point. when actually you want FROM AFTER. Your new question still stated 'from' I updated it to 'from after' ]
If does look like grep and -A1 aren't what you want though it's still mentioned even in your updated question
I don't see any funny results. Perhaps you can paste the results you think are funny. [you now have]
If you do grep pattern -A1 then it dumps the pattern followed by the next line. And it dumps --
after each match.
e.g.
$ cat t3.info
,,,
qwerty
uiop
,,,
werwer
werwer
,,,,,
werwerwer
werwerwer
werwerwer
,,,,
$ cat t3.info | grep -P ',,,' -A1
,,,
qwerty
--
,,,
--
,,,,,
werwerwer
--
,,,,
$
You could do grep -P '(?=---)...' -A1 Another thing you can try is this grep -P '\x2d{3}' -A1
And if your file has ---
$ cat t3.info
---
qwerty
uiop
---
werwer
werwer
---
werwerwer
werwerwer
werwerwer
---
Sure this doesn't work
$ cat t3.info | grep -P '---' -A1
grep: unrecognized option '---'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
But this works
$ cat t3.info | grep -P '\---' -A1
---
qwerty
--
---
--
---
werwerwer
--
---
and this works
$ cat t3.info | grep -P '(?=\x2d{3})...' -A1
---
qwerty
--
---
--
---
werwerwer
--
---
grep version 2.16
$ grep --version
grep (GNU grep) 2.16
If you don't want to be including your pattern then whatever option you use it wouldn't be -A1 and I don't see why you are having trouble with matching ---
It may be that to do what you want with grep or something grep like, you need to match new line e.g. e.g. regex of positive lookbehind.. for ---\n but apparently grep can't match new lines, in which case you might have more luck with pcregrep https://stackoverflow.com/questions/2686147/how-to-find-patterns-across-multiple-lines-using-grep or some other way. S oyour question is more, how can you match what follows on the line after a pattern.
this seems to work from my test with his test.info file – barlop – 2014-11-23T14:06:08.570
mmmm ... that's strange, why I don't have tac on the system? Is this a default command? – Andrea Moro – 2014-11-25T08:08:10.310
@AndreaMoro Just replace both
– αғsнιη – 2014-11-25T08:22:38.303tac
commands withtail -r
1Great. this works. – Andrea Moro – 2014-11-25T17:57:36.830