[英]Getting an error when defining an alias in the fish shell config file
我的config-fish文件中有以下别名:
alias em='emacsclient -n -c $PWD&'
但是我在启动新终端时看到此错误:
- (line 1): Variables may not be used as commands. In fish, please define a function or use 'eval $argv'.
emacsclient -n -c $PWD& $argv;
^
in function 'em'
called on standard input
在这种情况下我该怎么办?
首先要注意的是,fish alias
命令与bash alias
命令不同。 在鱼alias something
只是速记
function something
something $argv
end
在这种情况下,我建议将其缩写为: abbr em 'emacsclient -n -c $PWD&'
。 或者使用function
语法显式定义它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.