【问题标题】:passing the same file path to command after first command is done executing in an alias在别名中执行完第一个命令后将相同的文件路径传递给命令
【发布时间】:2014-03-13 07:05:10
【问题描述】:

我正在将 make 测试输出转储到文本文件中

make test > & ~/Desktop/makeTestOutput.txt

现在我想创建一个别名,一旦 make 测试转储完成,路径 ~/Desktop/makeTestOutput.txt 应该被下一个命令使用,我让 fetest 解释并在终端中显示可读数据。

我正在考虑这样做make test > & $1 | fetest $1,但这不会将文件路径通过管道传输到fetest

【问题讨论】:

    标签: shell command-line sh


    【解决方案1】:

    别名会自动处理参数,仅使用别名是不可能做你想做的事的。您应该改用函数。查看更多详情:https://unix.stackexchange.com/questions/3773/how-to-pass-parameters-to-an-alias

    【讨论】:

    • 我不懂shell脚本。
    猜你喜欢
    • 2017-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-07
    • 2018-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多