开发者社区 问答 正文

shell脚本执行异常,一直循环

screenshot
screenshotscreenshot脚本运行后,发现两个参数没有传递到function,而且程序一直循环,没找到错误,求解!!! 不胜感激!

展开
收起
杨冬芳 2016-07-08 18:02:26 2641 分享 版权
1 条回答
写回答
取消 提交回答
  • IT从业

    `Result_line=echo $line |grep ^[[:digit:]]|grep "XX"
    IP=echo $Result_line | awk '{print $1}'
    Result=echo $Result_line|tr -s [" "] [":"]|cut -d ":" -f $Item_num
    `
    赋值要加``或$()


    `
    Result_line=$(echo $line |grep ^[[:digit:]]|grep "XX")
    `

    2019-07-17 19:53:45
    赞同 展开评论