Assigning system command's output to variable

前端 未结 6 1200
梦毁少年i
梦毁少年i 2020-11-28 04:55

I want to run the system command in an awk script and get its output stored in a variable. I\'ve been trying to do this, but the command\'s output always goes t

6条回答
  •  失恋的感觉
    2020-11-28 05:59

    Figured out.

    We use awk's Two-way I/O

    {
      "strip $1" |& getline $1
    }
    

    passes $1 to strip and the getline takes output from strip back to $1

提交回复
热议问题