У меня есть следующий скрипт, скажем, ее название test.shКак собрать переменную строку
#!/bin/bash
b_x='it is the value of bx'
c_x='it is the value of cx'
case "$1" in
"b")
echo $1_x # it's doesn't work; I want to echo $b_x
;;
"c")
echo $1_x # it's doesn't work; I want to echo $c_x
;;
esac
И тогда я хочу, чтобы вызвать сценарий;
./test.sh b # I want the output is "it is the value of bx"
./test.sh c # I want the output is "it is the value of cx"
В чем вопрос? Каков ваш текущий результат? –