To print the whole buffer, you can use %p
, how do I print value of register to the standard output?
Here is example how I would print the whole buffer:
$ ex +'norm dw' +'%p' -scq! <(echo foo bar)
bar
So I'm looking for %p
equivalent printing way for registers, for example to print the last deletion (""
).
ex
and print what was deleted.ex +'%norm 2WdW' '+%p' -scq! <(echo 1 2 3 4 5)
in shell, but I want opposite, to print what was actually deleted.awk
is more stream oriented, so there are some limitations in more complex parsing scenarios. On the other side awk is quicker, as I did some benchmarking recently, but I want to learn ex/vi more efficiently.