Created
October 13, 2017 23:00
-
-
Save mhinz/ec6f0363ac083ab80613148d39b28121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# Emulate Vim executable that simply returns its arguments. | |
> /tmp/vim.rb <<EOF | |
#!/usr/bin/env ruby | |
p ARGV | |
EOF | |
chmod 700 /tmp/vim.rb | |
VISUAL="/tmp/vim.rb -c 'first arg'" | |
bad() { | |
${=VISUAL} -c 'second arg' -- $1 | |
} | |
good() { | |
eval "${VISUAL[@]} -c 'second arg' -- $1" | |
} | |
bad file | |
good file |
Author
mhinz
commented
Oct 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment