繁体   English   中英

在鱼壳配置文件中定义别名时出错

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM