Setting a variable in a while loop, in Bash

This question already has an answer here:

  • How to set a variable to the output of a command in Bash? 13 answers

  • You want command substitution:

    HASH=$(echo $l | awk '{print$1}')
    

    What you're using is a special syntax for executing programs with pre-set environment variables:

    var1=value progname args...
    

    Hence bash is complaining that the value of $l is not a command which could be found.

    链接地址: http://www.djcxy.com/p/57220.html

    上一篇: 在Git中查找何时删除文件

    下一篇: 在Bash中的while循环中设置一个变量