source: git/Singular/flexer.sh @ 52005b

spielwiese
Last change on this file since 52005b was 52005b, checked in by Michael Brickenstein <bricken@…>, 19 years ago
+ version correction git-svn-id: file:///usr/local/Singular/svn/trunk@7649 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.2 KB
Line 
1#!/bin/sh
2VERSION=`flex --version |sed -e "s/flex version //"`
3LV=`echo $VERSION|sed -e s/\.[0-9]*\.[0-9]*\$//`
4MIDV=`echo $VERSION|sed -e "s/^[0-9]*\.//"|sed -e s/\.[0-9]*\$//`
5TV=`echo $VERSION|sed -e s/^[0-9]*\.[0-9]*\\.//`
6#echo $LV $MIDV $TV
7#goodversion=""
8if [ $LV -lt 2 ];
9    then goodversion=true
10fi
11if [ $LV -eq 2 ];
12    then
13    if [ $MIDV -lt 5 ];
14        then goodversion=true
15    fi
16    if [ $MIDV -eq 5 ];
17        then
18        if [ $TV -le 4 ];
19            then goodversion=true;
20        fi
21    fi
22fi
23
24#echo $goodversion
25if [ -z $goodversion ];
26    then
27    #echo "bad version, trying to use touch"
28    for arg in $1 $2 $3 $4 $5 $6 $7 $8 $9
29      do
30      #echo loop
31      if [ -z $arg ];
32          then
33          dummy=0;
34      else
35          #echo `echo $arg|sed -e "s/-.*/SPECIALVALUE/"`
36          if  [ SPECIALVALUE = `echo $arg|sed -e "s/-.*/SPECIALVALUE/"` ];
37             
38              then
39              dummy=0;
40          else
41              file=$arg
42             
43          fi
44      fi
45    done
46    #echo file arg is $file
47    file2=`echo $file|sed -e "s/\.l$/\.cc/"`
48    #echo $file2
49    if [ -r $file2 ];
50        then
51        file3=`echo $file2|sed -e "s/\$/.tmp/"`
52        cp $file2 $file3
53        cat $file3
54    else
55        #echo "file does not exist"
56        exit 1;
57    fi
58       
59else
60    #echo "good version";
61    flex $1 $2 $3 $4 $5 $6 $7 $8 $9
62fi
Note: See TracBrowser for help on using the repository browser.