shell 遍历txt文件,取变量

比如a.txt
内容有 a=1
b=23
c=14
shell写脚本,然后取出b的值使用
我知道可以使用read和while读取每行的值

但不知道怎么提取出来具体值
求指导

#!/bin/bash
while read line
do
    eval "$line" 2>/dev/null
done < a.txt
echo $b

温馨提示:答案为网友推荐,仅供参考
相似回答