Define alias that references other aliases

前端 未结 4 1930
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 17:53

I\'d need to be able to define an alias in a Debian shell that includes other aliases, for a project I\'m currently working on.

Let\'s look at a code example to make thi

4条回答
  •  一生所求
    2021-02-05 18:58

    Following @anubhava's sage advice:

    foo() { echo foo; }
    bar() { echo bar; }
    foobar() { echo "$(foo)$(bar)"; }
    fooandbar() { echo "$(foo)and$(bar)"; }
    

    Spaces and semicolons inside {} are required there.

提交回复
热议问题