On Fri, 9 Feb 2007, Martin Krischik wrote:
> Am Freitag 09 Februar 2007 schrieb Charles E Campbell Jr:
> > :q :wq :q! -- these are normal quits (:wq also writes)
> > :
> > :cq -- quits, but Vim will return an error code
> >
>
> Thats exactly as far as I came without help. Now, what I was looking for
> was "quit without error code" - or better, since there is allways an error
> code, "quit with error code 'success'".
I don't know the answer to that, but...
>
> Currently Vim is seems to me that randomly chooses an error code to return -
> which is not good for bash scripts running in "set -o errexit" mode.
... would something like
( $(vim -E ...) || true )
solve this? Given (starting in tcsh) :
brains hgs 17 %> bash3
brains hgs ~ 61 $ set -o errexit
brains hgs ~ 62 $ false
brains hgs 18 %> bash3
brains hgs ~ 61 $ set -o errexit
brains hgs ~ 62 $ ( false || true )
brains hgs ~ 63 $ exit
exit
brains hgs 19 %>
>
> BTW: Any bash script author should at least consider to use "set -o errexit"
> it is a really usefull debugging tool.
Well, you don't seem to get much in thw way of diagnostics from it, but
thank you for mentioning it.
>
> Martin
>
HTH
Hugh