How do I get value of variable from file using shell script?

前端 未结 4 1061
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 05:41

There is a file post_check.ini I need the value set for:

Max_value=2

How would I get the value 2 from Max_v

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-15 06:17

    Max_value=$(sed -n '/^Max_value=\([0-9]*\)$/s//\1/p' post_check.ini)
    

提交回复
热议问题