十二12 发表于 2018-8-30 06:04:32

shell下alias 添加参数

  alias 默认是无法添加参数的,要想添加参数,只能定义一个函数来调用,示例如下:
  alias tcstart='new() { /root/bin/tc-single-start "$1"; /root/bin/tclog "$1"; }; new'
  其中注意:
  { /root/bin/tc-single-start 之间要有空格
  "$1"; } 之间 要有分号。

页: [1]
查看完整版本: shell下alias 添加参数