所以我这样做:
function wtfman(){
local command="vi /the/path/file.txt"
$($command)
}
与程序打开VI这条道路上
然而,渴望当我执行wtfman
它,而不是返回
Vim: Warning: Output is not to a terminal
我做错了什么,我该如何去改革这个功能,以便它相应地打开vi而不是只是抱怨?即我想要一个存储在一个字符串中的命令,我想执行该字符串指定的命令。它适用于其他所有,但它不适用于vi(可能是因为vi的全屏性质?)
的可能重复[为什么“locate filename | xargs vim”导致奇怪的终端行为?](http://stackoverflow.com/questions/8228831/why-does-locate-filename-x args-vim-cause-strange-terminal-behavior) – sehe
'wtfman(){vi /the/path/file.txt; }'?没有充分的理由将完整的命令和参数存储在单个变量中。 – chepner