次の内容のファイルがあります
ファイル名: VersionInfo.properties
Installed Version:13.7.0-2
Previous Version:13.6.0-12
ファイル名: main.sh
#!/bin/ksh
new_maj_version=$1 # sample content: 13.7.0
new_min_version=$2 # sample content: 4
main.sh を実行するたびに、VersionInfo.properties ファイルを編集する必要があります。インストールされたバージョンは以前のバージョンに移行し、私の new_maj_version と new_min_version はインストールされたバージョンに配置されます。どうすれば達成できますか?
main.sh を実行した後のサンプル出力
ファイル名: VersionInfo.properties
Installed Version:13.7.0-4
Previous Version:13.7.0-2