File: sver.sh

package info (click to toggle)
snack 2.2.10-dfsg1-12.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,024 kB
  • sloc: ansic: 35,473; sh: 8,557; tcl: 1,065; python: 701; makefile: 565
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