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.
8
questions
2
votes
1answer
30 views
Leading colons and whitespaces in Ex commands
Apparently, multiple colons are simply ignored when executing Ex commands. For example,
:set number!
:::set number!
: : :set number!
all toggle line numbers. Is this really a consolidated rule? ...
3
votes
2answers
102 views
POSIX compliant vi implementations
I found project called The Traditional Vi, but I think that description, readme and manual don't provide exact information about compliancy with POSIX. I tried looking for other implementations that ...
0
votes
2answers
214 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
288 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
108 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
120 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
314 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 ...