Tuesday, September 1, 2009

Re: goto line depending on exit code of filter

On Tue, Sep 1, 2009 at 2:55 AM, Tony Mechelynck wrote:
>
> Vim can jump to any line that it can count, the problem is having your
> external program generate the required number as a return code: IIRC,
> return codes are limited to one byte, and those above 127 may have a
> special meaning (generated by the OS maybe).

Depends on the OS, but on Unix...

Return codes are limited to one byte

Applications are free to return any number in that range, none of them
are "special", but...

The operating system often uses return codes between 128 and 255 to
indicate death by signal. The solaris machine I'm sitting in front of
uses 128 + (signal number) when an app dies of a signal, and Linux
uses the same. I could swear that an older version of solaris used
256 - (signal number), but I can't confirm that at the moment, so
don't quote me on that.

The 127 return code from bash isn't OS-level special, it's just a
convenience thing that bash does to make it easier to guess when a
script failed because it couldn't find a command.

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments: