Tuesday, February 28, 2012

Re: bash function output in vim function

On Mon, Feb 27, 2012, at 11:23 PM, Gary Johnson wrote:
> On 2012-02-27, sinbad wrote:
> > hi,
> >
> > here is what i want. i have a function in bash, based on some
> > criteria it emits a list of files, i want these list of files to be
> > used in vim's quickfix list. how can this be done. i tried like
> > this. The bash function is aliased to bashfunc, but the alias
> > is not available in vim's system() cmd, so i wrote a bash
> > script, which inturn source's the bashrc for the alias, and
> > calls the aliased cmd, when i call this script from vim's system()
> > it still doesn't work, am i missing something here.
>
> The bash(1) man page, in the ALIASES section, says:
>
> Aliases are not expanded when the shell is not interactive,
> unless the expand_aliases shell option is set using shopt (see
> the description of shopt under SHELL BUILTIN COMMANDS below).
>
> When executing your script, the shell is not interactive. So
> somewhere in your script, you need to put this command:
>
> shopt -s expand_aliases
>
> That will solve your alias expansion problem. Whether that is the
> best solution to your overall problem, whatever it is, I don't know.
>
> Regards,
> Gary
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

Hope this helped Sinbad, but even if it didn't it helped me.
Thanks Gary
--
Nick Hawk
sky2hawk@myopera.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment