V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
bigxu
V2EX  ›  Linux

如何在 fish shell 脚本中把命令写入历史?

  •  
  •   bigxu · 2021-01-30 17:59:51 +08:00 · 1524 次点击
    这是一个创建于 1174 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在 zsh 中我可以这样

    #!/bin/zsh cmd="cd /special/dir" print -s $cmd" # save command in history for reuse

    这样的我的 history 中就会有一个 cd /special/dir 历史。

    在 fish shell 该怎么搞? ~

    1 条回复    2021-02-01 02:09:53 +08:00
    vcfvct
        1
    vcfvct  
       2021-02-01 02:09:53 +08:00
    也可以试试:
    https://github.com/jethrokuan/z
    可以少用很多 cd,
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5656 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:43 · PVG 10:43 · LAX 19:43 · JFK 22:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.