For example, if I want to find all bar lines and print them.
$ cat file
line foo
line bar 1
line bar 2
$ cat cmd
norm gg
/bar
p
norm n
p
$ cat cmd | vim -u NONE -es file
line bar 1
line bar 1
$
As it outputs, normal n does not move to line bar 2.
normal nndoes work for me, but I'm not entirely sure why – Martin Tournoij Feb 08 '21 at 10:22