【发布时间】:2016-01-04 18:49:10
【问题描述】:
考虑下面的例子:
Parameter1 = 5
Parameter2 = 10
Parameter3 = 15
Parameter4 = 20
我想通过提供如下所示的用户输入来根据参数名称获取值:
echo ""
echo " Enter the parameter name"
read value
Parameter = "$value"
检查参数是否存在于关注文件中
if grep -qs "$Parameter" "Filename"
then
echo " Parameter exist within the concern file"
val = #Here I want to fetch the value of the parameter that the user had input and I do not know how to do it?
请告诉我如何获取用户输入的参数值。
【问题讨论】: