source: git/Singular/flexer.sh @ c90500

spielwiese
Last change on this file since c90500 was 5d98d06, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: sunos patches git-svn-id: file:///usr/local/Singular/svn/trunk@10698 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/^.*version //"|sed -e "s/^flex //"`
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        cat $file2
55    else
56        #echo "file does not exist"
57        exit 1;
58    fi
59       
60else
61    #echo "good version";
62    flex $1 $2 $3 $4 $5 $6 $7 $8 $9
63fi
Note: See TracBrowser for help on using the repository browser.