Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
bigxu
V2EX  ›  Linux

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

  •  
  •   bigxu · Jan 30, 2021 · 2450 views
    This topic created in 1928 days ago, the information mentioned may be changed or developed.

    在 zsh 中我可以这样

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

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

    在 fish shell 该怎么搞? ~

    1 replies    2021-02-01 02:09:53 +08:00
    vcfvct
        1
    vcfvct  
       Feb 1, 2021
    也可以试试:
    https://github.com/jethrokuan/z
    可以少用很多 cd,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5512 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 05:47 · PVG 13:47 · LAX 22:47 · JFK 01:47
    ♥ Do have faith in what you're doing.