How to create unix alias with command substitution?

后端 未结 2 614
挽巷
挽巷 2021-01-27 21:21

I would like to create an alias for the following. Would you please let me know how to set this up?

mate  \\`find . -name \\`
相关标签:
2条回答
  • 2021-01-27 22:09

    This is an indirect solution. Put the command in a file (whithout .sh say cmdfile) under ~/bin then give the alias as alias myalias=cmdfile

    0 讨论(0)
  • 2021-01-27 22:18

    use a function instead: mymate() { mate $(find . -name "$1"); }

    0 讨论(0)
提交回复
热议问题