History Report a problem
Article Edit this page Discussion

Find VIMRUNTIME in a bash script

From Vim Tips Wiki

Jump to: navigation, search
 

Tip 745Previous TipNext Tip

Created: June 15, 2004 Complexity: advanced Author: Steve Hall Minimum version: 6.0 Karma: 13/4 Imported from: Tip#745


I recently needed the value of $VIMRUNTIME in a bash shell script and was forwarded these two terrific solutions that may be of use to others.

vim --cmd 'echo $VIMRUNTIME' --cmd 'quit' 2> /tmp/VIMRUNTIME.txt
VIMRUNTIME=`perl -pe 's/\r\n//g' /tmp/VIMRUNTIME.txt`
rm -f /tmp/VIMRUNTIME.txt
VIMRUNTIME=`vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $VIMRUNTIME|quit' | tr -d '\015' `

Both properly capture Vim's output and handle the trailing line feed, although in remarkably different ways.

[edit] Comments

 

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Find VIMRUNTIME in a bash script"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation