Christian wrote:
> having read :h expand-env, I suspected that this also works on Windows,
> however it does not seem to be the case:
>
> :echo $PATH
> " This correctly shows the path, but neither of the following work:
> :echo expand("$PATH")
> :echo expand("%PATH%")
>
> My use case is to have cmd.exe return a pseudo random number by using
> %random%. However it looks like vim on windows cannot expand environment
> variables.
expand() wasn't made for expanding environment variables. Why not use
$PATH directly?
Not sure if $random works, might be something built into cmd.exe. You
could try using system('echo %random%'), but it's likely slower.
--
"Microsoft is like Coke. It's a secret formula, all the money is from
distribution, and their goal is to get Coke everywhere. Open source is like
selling water. There are water companies like Perrier and Poland Spring, but
you're competing with something that's free." -- Carl Howe
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.