我正在尝试在目录中的可执行文件中加上一个空格作为别名。例如:
alias myfile="/home/ben/test case/myfile"
现在,这并没有按照我想要的方式扩展(它认为/home/ben/test
是可执行文件)。在bash中,您可以添加额外的引号:
alias myfile="'/home/ben/test case/myfile'"
可悲的是,在鱼中这是行不通的。我该怎么办呢?
fish中的alias只是内置函数的包装,它的存在是为了与POSIX shell向后兼容。alias
infish
不能用作POSIX别名。
如果要alias
使用POSIX等效,则必须使用在fish 2.2.0中添加的abbr:
abbr -a myfile "'/home/ben/test case/myfile'"
或者:
abbr -a myfile "/home/ben/test\ case/myfile"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句