Bsp :
Code: Alles auswählen
cvs: 1.12.13
./toolchecker.sh: line 21: --version: command not found
autoconf >= 2.57a:
Code: Alles auswählen
CVS=`which cvs`
Code: Alles auswählen
if ( test -e autoconf ) then
ist dann immer erfüllt
Ich habe das script nun abgeändert und schreibe eine Wert in die Variable wenn diese leer ist somit hat dann "test" was zum auswerten
Code: Alles auswählen
: ${AUTOCONF:=not_installed}
hier das ganze script :
Code: Alles auswählen
#! /bin/bash
CUT=`which cut`
GREP=`which grep`
echo ""
echo ""
### cvs ###
CVS=`which cvs`
: ${CVS:=not_installed}
if ( test -e $CVS ) then
echo -e "cvs: "`$CVS --version | $GREP Concurrent | $CUT -f5 -d " "`
else
echo -e "\033[37;41mcvs nicht installiert\033[37;40m"
fi;
### autoconf >= 2.57a ###
AUTOCONF=`which autoconf`
: ${AUTOCONF:=not_installed}
#echo $AUTOCONF
if ( test -e autoconf ) then
echo "autoconf >= 2.57a: "`$AUTOCONF --version | $GREP "autoconf " | $CUT -f4 -d " "`
else
echo -e "\033[37;41mautoconf nicht installiert, bitte Version >= 2.57a installieren\033[37;40m"
fi;
### automake >= 1.7 ###
AUTOMAKE=`which automake`
: ${AUTOMAKE:=not_installed}
if ( test -e automake ) then
echo "automake >= 1.8: "`$AUTOMAKE --version | $GREP "automake " | $CUT -f4 -d " "`
else
echo -e "\033[37;41mautomake nicht installiert, bitte Version >= 1.8 installieren\033[37;40m"
fi;
### libtool >= 1.4.2 ###
LIBTOOL=`which libtool`
: ${LIBTOOL:=not_installed}
if ( test -e libtool ) then
echo "libtool >= 1.4.2: "`$LIBTOOL --version | $GREP "libtool)" | $CUT -f4 -d " "`
else
echo -e "\033[37;41mlibtool nicht installiert, bitte Version >= 1.4.2 installieren\033[37;40m"
fi;
### gettext >= 0.12.1 ###
GETTEXT=`which gettext`
: ${GETTEXT:=not_installed}
if ( test -e gettext ) then
echo "gettext >= 0.12.1: "`$GETTEXT --version | $GREP gettext | $CUT -f4 -d " "`
else
echo -e "\033[37;41mgettext nicht installiert, bitte Version >= 0.12.1 installieren\033[37;40m"
fi;
### make >= 3.79 ###
MAKE=`which make`
: ${MAKE:=not_installed}
if ( test -e make ) then
echo "make >= 3.79: "`$MAKE --version | $GREP Make | $CUT -f3 -d " "`
else
echo -e "\033[37;41mmake nicht installiert, bitte Version >= 3.79 installieren\033[37;40m"
fi;
### makeinfo (texinfo) ###
MAKEINFO=`which makeinfo`
: ${MAKEINFO:=not_installed}
if ( test -e makeinfo ) then
echo "makeinfo: "`$MAKEINFO --version | $GREP makeinfo | $CUT -f4 -d " "`
else
echo -e "\033[37;41mmakeinfo nicht installiert\033[37;40m"
fi;
### tar ###
TAR=`which tar`
: ${TAR:=not_installed}
if ( test -e $TAR ) then
echo "tar: "`$TAR --version | $GREP tar | $CUT -f4 -d " "`
else
echo -e "\033[37;41mtar nicht installiert\033[37;40m"
fi;
### bunzip2 (bzip2) ###
BUNZIP2=`which bunzip2`
: ${BUNZIP2:=not_installed}
if ( test -e $BUNZIP2 ) then
echo "bunzip2: "`bunzip2 --help 2> btmp; $GREP Version < btmp | $CUT -c 50-54; rm btmp`
else
echo -e "\033[37;41mbunzip2 nicht installiert\033[37;40m"
fi;
### gunzip (gzip) ###
GUNZIP=`which gunzip`
: ${GUNZIP:=not_installed}
if ( test -e $GUNZIP ) then
echo "gunzip: "`$GUNZIP --version | $GREP gunzip | $CUT -f2 -d " "`
else
echo -e "\033[37;41mgunzip nicht installiert\033[37;40m"
fi;
### patch ###
PATCH=`which patch`
: ${PATCH:=not_installed}
if ( test -e $PATCH ) then
echo "patch: "`$PATCH --version | $GREP "patch " | $CUT -f2 -d " "`
else
echo -e "\033[37;41mpatch nicht installiert\033[37;40m"
fi;
### infocmp (ncurses-bin / ncurses-devel) ###
INFOCMP=`which infocmp`
: ${INFOCMP:=not_installed}
if ( test -e $INFOCMP ) then
echo "infocmp: "`$INFOCMP -V | $GREP ncurses | $CUT -f2 -d " "`
else
echo -e "\033[37;41minfocmp nicht installiert\033[37;40m"
fi;
### gcc 2.95 or >= 3.0 ###
GCC=`which gcc`
: ${GCC:=not_installed}
if ( test -e $GCC ) then
echo "gcc 2.95 or >= 3.0: "`$GCC --version | $GREP gcc | $CUT -f3 -d " "`
else
echo -e "\033[37;41mgcc nicht installiert, bitte Version 2.95 or >= 3.0 installieren\033[37;40m"
fi;
### g++ 2.95 or >= 3.0 ###
CCC=`which g++`
: ${CCC:=not_installed}
if ( test -e $CCC ) then
echo "g++ 2.95 or >= 3.0: "`$CCC --version | $GREP g++ | $CUT -f3 -d " "`
else
echo -e "\033[37;41mg++ nicht installiert, bitte Version 2.95 or >= 3.0 installieren\033[37;40m"
fi;
### flex ###
FLEX=`which flex`
: ${FLEX:=not_installed}
if ( test -e $FLEX ) then
echo "flex: "`$FLEX --version | $GREP flex | $CUT -f2 -d " "`
else
echo -e "\033[37;41mflex nicht installiert\033[37;40m"
fi;
### bison ###
BISON=`which bison`
: ${BISON:=not_installed}
if ( test -e $BISON ) then
echo "bison: "`$BISON --version | $GREP Bison | $CUT -f4 -d " "`
else
echo -e "\033[37;41mbison nicht installiert\033[37;40m"
fi;
### pkg-config ###
PKGCONFIG=`which pkg-config`
: ${PKGCONFIG:=not_installed}
if ( test -e $PKGCONFIG ) then
echo "pkg-config: "`$PKGCONFIG --version | $GREP .`
else
echo -e "\033[37;41mpkg-config nicht installiert\033[37;40m"
fi;
### wget ###
WGET=`which wget`
: ${WGET:=not_installed}
if ( test -e $WGET ) then
echo "wget: "`$WGET --version | $GREP Wget | $CUT -f3 -d " "`
else
echo -e "\033[37;41wget nicht installiert\033[37;40m"
fi;
echo ""
echo ""#! /bin/bash
CUT=`which cut`
GREP=`which grep`
echo ""
echo ""
### cvs ###
CVS=`which cvs`
: ${CVS:=not_installed}
if ( test -e $CVS ) then
echo -e "cvs: "`$CVS --version | $GREP Concurrent | $CUT -f5 -d " "`
else
echo -e "\033[37;41mcvs nicht installiert\033[37;40m"
fi;
### autoconf >= 2.57a ###
AUTOCONF=`which autoconf`
: ${AUTOCONF:=not_installed}
#echo $AUTOCONF
if ( test -e autoconf ) then
echo "autoconf >= 2.57a: "`$AUTOCONF --version | $GREP "autoconf " | $CUT -f4 -d " "`
else
echo -e "\033[37;41mautoconf nicht installiert, bitte Version >= 2.57a installieren\033[37;40m"
fi;
### automake >= 1.7 ###
AUTOMAKE=`which automake`
: ${AUTOMAKE:=not_installed}
if ( test -e automake ) then
echo "automake >= 1.8: "`$AUTOMAKE --version | $GREP "automake " | $CUT -f4 -d " "`
else
echo -e "\033[37;41mautomake nicht installiert, bitte Version >= 1.8 installieren\033[37;40m"
fi;
### libtool >= 1.4.2 ###
LIBTOOL=`which libtool`
: ${LIBTOOL:=not_installed}
if ( test -e libtool ) then
echo "libtool >= 1.4.2: "`$LIBTOOL --version | $GREP "libtool)" | $CUT -f4 -d " "`
else
echo -e "\033[37;41mlibtool nicht installiert, bitte Version >= 1.4.2 installieren\033[37;40m"
fi;
### gettext >= 0.12.1 ###
GETTEXT=`which gettext`
: ${GETTEXT:=not_installed}
if ( test -e gettext ) then
echo "gettext >= 0.12.1: "`$GETTEXT --version | $GREP gettext | $CUT -f4 -d " "`
else
echo -e "\033[37;41mgettext nicht installiert, bitte Version >= 0.12.1 installieren\033[37;40m"
fi;
### make >= 3.79 ###
MAKE=`which make`
: ${MAKE:=not_installed}
if ( test -e make ) then
echo "make >= 3.79: "`$MAKE --version | $GREP Make | $CUT -f3 -d " "`
else
echo -e "\033[37;41mmake nicht installiert, bitte Version >= 3.79 installieren\033[37;40m"
fi;
### makeinfo (texinfo) ###
MAKEINFO=`which makeinfo`
: ${MAKEINFO:=not_installed}
if ( test -e makeinfo ) then
echo "makeinfo: "`$MAKEINFO --version | $GREP makeinfo | $CUT -f4 -d " "`
else
echo -e "\033[37;41mmakeinfo nicht installiert\033[37;40m"
fi;
### tar ###
TAR=`which tar`
: ${TAR:=not_installed}
if ( test -e $TAR ) then
echo "tar: "`$TAR --version | $GREP tar | $CUT -f4 -d " "`
else
echo -e "\033[37;41mtar nicht installiert\033[37;40m"
fi;
### bunzip2 (bzip2) ###
BUNZIP2=`which bunzip2`
: ${BUNZIP2:=not_installed}
if ( test -e $BUNZIP2 ) then
echo "bunzip2: "`bunzip2 --help 2> btmp; $GREP Version < btmp | $CUT -c 50-54; rm btmp`
else
echo -e "\033[37;41mbunzip2 nicht installiert\033[37;40m"
fi;
### gunzip (gzip) ###
GUNZIP=`which gunzip`
: ${GUNZIP:=not_installed}
if ( test -e $GUNZIP ) then
echo "gunzip: "`$GUNZIP --version | $GREP gunzip | $CUT -f2 -d " "`
else
echo -e "\033[37;41mgunzip nicht installiert\033[37;40m"
fi;
### patch ###
PATCH=`which patch`
: ${PATCH:=not_installed}
if ( test -e $PATCH ) then
echo "patch: "`$PATCH --version | $GREP "patch " | $CUT -f2 -d " "`
else
echo -e "\033[37;41mpatch nicht installiert\033[37;40m"
fi;
### infocmp (ncurses-bin / ncurses-devel) ###
INFOCMP=`which infocmp`
: ${INFOCMP:=not_installed}
if ( test -e $INFOCMP ) then
echo "infocmp: "`$INFOCMP -V | $GREP ncurses | $CUT -f2 -d " "`
else
echo -e "\033[37;41minfocmp nicht installiert\033[37;40m"
fi;
### gcc 2.95 or >= 3.0 ###
GCC=`which gcc`
: ${GCC:=not_installed}
if ( test -e $GCC ) then
echo "gcc 2.95 or >= 3.0: "`$GCC --version | $GREP gcc | $CUT -f3 -d " "`
else
echo -e "\033[37;41mgcc nicht installiert, bitte Version 2.95 or >= 3.0 installieren\033[37;40m"
fi;
### g++ 2.95 or >= 3.0 ###
CCC=`which g++`
: ${CCC:=not_installed}
if ( test -e $CCC ) then
echo "g++ 2.95 or >= 3.0: "`$CCC --version | $GREP g++ | $CUT -f3 -d " "`
else
echo -e "\033[37;41mg++ nicht installiert, bitte Version 2.95 or >= 3.0 installieren\033[37;40m"
fi;
### flex ###
FLEX=`which flex`
: ${FLEX:=not_installed}
if ( test -e $FLEX ) then
echo "flex: "`$FLEX --version | $GREP flex | $CUT -f2 -d " "`
else
echo -e "\033[37;41mflex nicht installiert\033[37;40m"
fi;
### bison ###
BISON=`which bison`
: ${BISON:=not_installed}
if ( test -e $BISON ) then
echo "bison: "`$BISON --version | $GREP Bison | $CUT -f4 -d " "`
else
echo -e "\033[37;41mbison nicht installiert\033[37;40m"
fi;
### pkg-config ###
PKGCONFIG=`which pkg-config`
: ${PKGCONFIG:=not_installed}
if ( test -e $PKGCONFIG ) then
echo "pkg-config: "`$PKGCONFIG --version | $GREP .`
else
echo -e "\033[37;41mpkg-config nicht installiert\033[37;40m"
fi;
### wget ###
WGET=`which wget`
: ${WGET:=not_installed}
if ( test -e $WGET ) then
echo "wget: "`$WGET --version | $GREP Wget | $CUT -f3 -d " "`
else
echo -e "\033[37;41wget nicht installiert\033[37;40m"
fi;
echo ""
echo ""
Martin