mooc/www/sys/setVersion.sh

18 lines
545 B
Bash
Raw Permalink Normal View History

2023-01-31 09:52:15 +04:00
#!/bin/bash
file=$1
if [ -f ${file} ]; then
av=$( grep versionWeblinux ${file} | sed -e 's/.*<\/font>//' -e 's/<\/span>.*//' )
echo "Version actuelle : -->${av}<--"
echo -n "Entrez la version souhaitée : "
read nv
mv ${file} /tmp/index.$$
cat /tmp/index.$$ | sed -e 's/\(.*\)versionWeblinux\(.*\)<\/font>.*$/\1versionWeblinux\2<\/font>'${nv}'<\/span><\/td>/' > ${file}
av=$( grep versionWeblinux ${file} | sed -e 's/.*<\/font>//' -e 's/<\/span>.*//' )
echo "version set to ${av}"
else
echo "${file} not found"
fi