File: sver.sh

package info (click to toggle)
snack 2.2.10.20090623-dfsg-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,276 kB
  • ctags: 3,784
  • sloc: ansic: 32,654; sh: 8,558; tcl: 1,086; python: 701; makefile: 564
file content (20 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#/bin/bash

RESULT=`grep SNACK_VERSION "$1"`
THIS_ONE=0
for i in $RESULT; do
   if test "$THIS_ONE" = "1" ; then
     #echo "THIS ONE is \'$i\'"
     LEN=`expr length "$i"`
     #echo "LEN is $LEN"
     END=`expr $LEN - 2`
     #echo "END is $END"
     VERSION=`expr substr "$i" 2 $END`
   fi
   if test "$i" = "SNACK_VERSION"; then
     THIS_ONE=1
   fi
done
#echo "final VERSION is '$VERSION'"
echo $VERSION