Questions tagged [posix]

The POSIX tag is for questions about the POSIX-standardized features for `ex` and `vi`, which differ occasionally from the "original-vi" implementation.

Filter by
Sorted by
Tagged with
0
votes
2answers
93 views

Why is `vim -E` always exiting with non-zero exit code when using here-doc?

see the following session in dash: $ printf "foo\nbar\n" > testfile $ cat testfile foo bar $ vim -E testfile <<-EOS > 1 > s/foo/baz/ > x > EOS $ echo $? 1 $ cat testfile baz bar $...
2
votes
1answer
218 views

Print current line number to stdout using ex

I often use ex in scripted edits. I can run several editing commands, and then save the changed file, with no danger of hanging if an ex command encounters an error, by running commands like so: ...
0
votes
1answer
92 views

Increment a number using POSIX features only?

Of course in Vim you have <C-a> to increment a number. Is this POSIX specified? How can I increment (or decrement) a number portably, such as in a scripted edit with ex? Even if the answer is ...
2
votes
3answers
109 views

Cause `ex` to automatically exit without saving if a pattern isn't found?

I'm big on scripted file edits using POSIX ex rather than sed -i and co. The big trick of course is how to ensure ex doesn't hang waiting for input if an error is encountered. I just wrote a comment ...
9
votes
2answers
223 views

Use ex-command to check whether two lines are identical?

I was looking at this question and then wondered how I might implement my answer which uses sed using purely POSIX ex. The trick is that while in sed I can compare the hold space with the pattern ...
3
votes
2answers
1k views

What are differences between POSIX vi and minimal vi implementations, if any?

I have a few questions about vi and its current relationship with Vim. First of all, is Vim minimal (i.e. the default vi on Cygwin) basically a POSIX compliant implementation of vi? I believe POSIX ...