何らかの理由で、最初の値が常に出力されます。私はそれの背後にある理由を理解することはできません。何か案は?elif文が常に最初の値を出力する場合
#!/bin/bash
config="update_release"
if [[ "$config"=="update" ]]; then
schema_list="main_schemas"
elif [[ "$config"=="update_release" ]] ; then
schema_list="release_schemas"
elif [[ "$config"=="update_maintenance" ]]; then
schema_list="maintenance_schemas"
fi
echo $schema_list
私はsingle =、single []を含めて多くのことを試しましたが、全く何も動作していないようです。
は[shellcheck]試しにしようとしているかのロジックを再考すべきだと思う空白フレーミング(http://shellcheck.net) –