foo=`cat bar`
... and then the variable $foo will be the content of the file "bar."
I want to use the cat command to assign a value in my vimrc. I'm sure this
is possible, but I can't figure it out.
--
View this message in context: http://vim.1045645.n5.nabble.com/can-I-do-command-substitutions-in-vimscript-tp4982601p4982601.html
Sent from the Vim - General mailing list archive at Nabble.com.
let foo = system('cat bar')
where the string passed to system() can be any arbitrary shell command.
let foo=system('cat bar')
or let foo = join(readfile('bar'),"\n") # lookup binary options
> I want to use the cat command to assign a value in my vimrc. I'm sure this
> is possible, but I can't figure it out.
Why do you want to use cat? ..
Marc Weber
--
View this message in context: http://vim.1045645.n5.nabble.com/can-I-do-command-substitutions-in-vimscript-tp4982601p4982982.html