Read result of sha256sum into a bash variable
This question already has an answer here:
You don't need store it in a variable. You can directly redirect it to the file as well.
sha256sum debug_2.0.5.hex | awk '{print $1}' > dsl
If you do need to store it in a variable for some other purpose then:
read -r shm_id rest <<<"$(sha256sum scr)"
echo $shm_id > dsl
or
shm_id=$(sha256sum scr | awk '{print $1}')
链接地址: http://www.djcxy.com/p/57214.html
上一篇: 将LFTP结果输出到变量