i have file following info
filename:versioninfo.properties
installed version:13.7.0-2 previous version:13.6.0-12
filename: rollback.sh
#!/bin/bash uninstall_rpm clientinfrastructure $version
how can value variable $version previous version of versioninfo.properties file. $version should have value 13.6.0-12
sed
solution:
version=$(sed -n 's/previous version:\(.*\)/\1/p' versioninfo.properties)
to use in script can do:
#!/bin/bash version=$(sed -n 's/previous version:\(.*\)/\1/p' versioninfo.properties) uninstall_rpm clientinfrastructure "$version"
if have in script can on command line.
uninstall_rpm clientinfrastructure "$(sed -n 's/previous version:\(.*\)/\1/p' versioninfo.properties)"
Comments
Post a Comment