所以我這樣做:
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