gpt4 book ai didi

linux - 如何为一长串 CL 命令创建别名(缩写版本)?

转载 作者:太空宇宙 更新时间:2023-11-04 10:43:37 25 4
gpt4 key购买 nike

所以我有一长串命令需要一遍又一遍地运行(使用 Linux 终端)...示例:

./path/foo --input_file <something interesting>
--output_file <should equal input + random suffix>
--other_flags <need freedom here>
./path/bar --input_file <should be same input file>
--input_file2 <should be same as output file>
--output_file <should be original input name with some prefix>

那么如何在 bash 中编写这样的字符串并运行它呢?

最佳答案

您可以在 PATH variable 提到的目录中添加一些可执行的 shell 脚本.

您还可以定义一些 shell functions对于你的交互式 shell,通常在你的 ~/.bashrc

关于linux - 如何为一长串 CL 命令创建别名(缩写版本)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34017479/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com