shell工具——fish

1、介绍

  Fish 是"the friendly interactive shell"的简称。

  最大特点:方便易用。不需要任何配置。

2、软件安装

  yum install fish -y

3、修改系统默认shell

  chsh -s /usr/bin/fish username

  目的:以便能够默认直接使用fish。若因为这样那样问题设置不成功(我就是因为公司云开发机问题导致不成功),命令行手动输入fish吧。

  

 

备忘来自网络:

兼容bash脚本

由于fish 很多不兼容bash的功能导致了很多脚本无法运行,这一点是很多人吐槽fish的地方,我们需要一种方式来运行bash脚本。

比如

arc land --onto `git rev-parse --abbrev-ref HEAD`

这条命令在fish里无法执行。 我们只需要在前面添加一个bash -c 命令即可,如下所示。

bash -c "arc land --onto `git rev-parse --abbrev-ref HEAD`"

顺手加个alias就更方便了,可以直接在命令行里使用命令arcl

alias arcl bash -c "arc land --onto `git rev-parse --abbrev-ref HEAD`"

对于脚本文件,比如我将需要执行的命令或文件放到repomerge.sh

在~/.config/fish/config.fish添加

alias up "bash -c /usr/bin/repomerge.sh"

然后就可以自由的使用up命令了

 

 

要想成长,行走在路上,沐浴更多的阳光。。。

posted on 2021-12-21 17:53  爱学习的小灵子  阅读(538)  评论(0)    收藏  举报