Saturday, August 22, 2009

Re: how to ignore stderr in filter

bill lam wrote:
> Another problem for filter. I found that vim will get both stdout and
> stderr from a filter. eg
>
> cat foo
> #/bin/sh
> ls --funny
> echo abc
>
> execute :%!foo will copy all of the following to vim buffer
>
> ls: unrecognized option `--funny'
> Try `ls --help' for more information.
> abc
>
> It it possible to exclude output from stderr?
>
Yes.
:%!foo 2> /dev/null

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

No comments: