Debian Codegraph @

install/unix/getvers

raw symbols SCIP
1 #! /bin/bash
2 #.COPYRIGHT: Copyright (c) 2005-2006 European Southern Observatory,
3 #
4 #.TYPE command
5 #.NAME getvers.sh
6 #.LANGUAGE shell script
7 #.ENVIRONMENT Unix Systems. Executable under bash shell !
8 #
9 #
10 #.COMMENTS check the version of the GNU C compiler
11 #.AUTHOR K. Banse ESO - Garching
12 #
13 #.VERSION
14 # 051026 creation
15 # 070615 last modif
16 #
17
18
19 gcc -v > gcc.version 2>&1 # save output in file ./gcc.version
20
21 # read the file ./gcc.version line by line, process only the last one
22
23 while read line
24 do
25 begi=${line:0:12}
26 if [ "$begi" = "gcc version " ] ; then
27 longversion=${line#"gcc version "}
28 version=${longversion:0:1}
29 if [ "$version" = "4" ] ; then
30 echo gfortran
31 else
32 echo g77
33 fi
34 fi
35 done < gcc.version
36
37 rm gcc.version
38
39 exit 0