On 2020-06-15, Peter Whittaker wrote:
> On Fri, Jun 12, 2020 at 1:36 PM Bram Moolenaar <b...@moolenaar.net> wrote:
> > Peter Whittaker wrote:
> >
> > > vimrntm=$(vim --not-a-term -T dumb --cmd 'echo $VIMRUNTIME' --cmd quit | \
> > > tr -d '\n\r' |sed -E 's,[^/]+,,')
> > >
> > > What I'd really like is "vimrntm=$(vim --get-vimruntime)"
> >
> > I think you already found a way that works:
> >         vi --not-a-term -c 'echo $VIMRUNTIME' -c q
> >
> > Why would a command line argument be needed that would do the same
> > thing?
> 
> It's not exactly doing the same thing: The existing capability
> requires post-processing to remove extraneous characters, which isn't
> surprising, since those characters aren't extraneous for vim's default
> behaviour, which is managing a graphical display. Based on a 10+ year
> old example I found online, I hacked together a double pipeline of tr
> and sed to remove those characters, but that's definitely ugly, and it
> also feels fragile: I'm hardcoding in knowledge of what those
> characters are; it works everywhere I need it to right now, but it
> feels iffy.

I just threw this together and saw no extraneous characters.

    $ vim -u NONE -es -c '!echo $VIMRUNTIME' -c q

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20200615193831.GC29345%40phoenix.

Raspunde prin e-mail lui