开发者社区 问答 正文

怎么用shell脚本获取dstat命令输入的第2行呢

怎么用shell脚本获取dstat命令输入的第2行呢

展开
收起
a123456678 2016-06-15 14:27:55 2283 分享 版权
1 条回答
写回答
取消 提交回答
  • 获取命令输入的第二行?是参数吧

    给你个例子:

    [root@server ~]# 
    [root@server ~]# testfunc () { echo "$# parameters"; echo "$@"; }
    [root@server ~]# testfunc
    0 parameters
     
    [root@server ~]# testfunc a b c
    3 parameters
    a b c
    [root@server ~]# testfunc a "b c"
    2 parameters
    a b c
    [root@server ~]# testfunc a "b c" \
    > par3
    3 parameters
    a b c par3
    2019-07-17 19:39:10
    赞同 展开评论
问答分类:
问答地址: