aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/xolox/misc/os.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/xolox/misc/os.vim')
-rw-r--r--autoload/xolox/misc/os.vim12
1 files changed, 10 insertions, 2 deletions
diff --git a/autoload/xolox/misc/os.vim b/autoload/xolox/misc/os.vim
index ef036df..8add797 100644
--- a/autoload/xolox/misc/os.vim
+++ b/autoload/xolox/misc/os.vim
@@ -1,9 +1,9 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: May 13, 2013
+" Last Change: May 19, 2013
" URL: http://peterodding.com/code/vim/misc/
-let g:xolox#misc#os#version = '0.2'
+let g:xolox#misc#os#version = '0.3'
function! xolox#misc#os#is_win() " {{{1
" Check whether Vim is running on Microsoft Windows.
@@ -72,6 +72,14 @@ function! xolox#misc#os#exec(options) " {{{1
endif
endif
+ " Execute the command line using 'sh' instead of the default shell,
+ " because we assume that standard output and standard error can be
+ " redirected separately, but (t)csh does not support this.
+ if has('unix')
+ call xolox#misc#msg#debug("os.vim %s: Generated shell expression: %s", g:xolox#misc#os#version, cmd)
+ let cmd = printf('sh -c %s', xolox#misc#escape#shell(cmd))
+ endif
+
" Let the user know what's happening (in case they're interested).
call xolox#misc#msg#debug("os.vim %s: Executing external command using system() function: %s", g:xolox#misc#os#version, cmd)
call system(cmd)