JDieskau
03-07-2004, 14:25
Also ich hab ein kleines Shell Script. Jetzt hab ich aber das Problem das es einfach stehen bleibt - keine Fehlermeldung - einfach nix. Wenn ich das ganze Schritt für Schritt in einer Konsole manuel mache, dann gehts ohne Probleme! Komisch :(
Also das ist der Teil von Bash Script:
if [ $1 = "--update" ]
then
cd /tmp/
#### Aktualisieren der discr ####
discrz=0
wget http://jdcvs.sourceforge.net/home/discr 2> /tmp/jdcvs-wget-discr >> /tmp/jdcvs-wget-discr
wget http://jdcvs.sourceforge.net/home/discr2 2> /tmp/jdcvs-wget-discr2 >> /tmp/jdcvs-wget-discr2
schleife=$(grep "entries=" /tmp/discr | sed s/entries=//g)
while [ $schleife != 0 ] 2> /dev/null
do
echo $schleife
#####################
#### HIER BLEIBT ER STEHEN!##
#####################
appsname=$(grep "§$schleife=" /tmp/discr | sed s/"§$schleife"=//g)
if [ $(grep -c $appsname ~/.jdcvs/discr) = 0 ]
then
discrname=$(grep "§$schleife=" /tmp/discr | sed s/§$schleife=//g)
discr=$(grep $discrname /tmp/discr2 | sed s/$discrname=//g)
discrz=$(expr $discrz + 1)
echo "$discrname=$discr" >> ~/.jdcvs/discr
fi
schleife=$(expr $schleife - 1)
done
rm /tmp/discr
rm /tmp/discr2
echo -e "\n$discrz $(grep "§77=" ~/.jdcvs/lang/$lang | sed s/§77=//g)"
#### Aktualisieren der sources ####
cd /tmp
sourcesz=0
wget http://jdcvs.sourceforge.net/home/sources 2> /tmp/jdcvs-wget-sources >> /tmp/jdcvs-wget-sources
wget http://jdcvs.sourceforge.net/home/sources2 2> /tmp/jdcvs-wget-sources2 >> /tmp/jdcvs-wget-sources2
schleife=$(grep "entries=" /tmp/sources | sed s/entries=//g)
while [ $schleife != 0 ]
do
if [ $(grep -c $(grep "§$schleife=" /tmp/sources | sed s/§$schleife=//g) ~/.jdcvs/sources) = 0 ]
then
sourcesname=$(grep "§$schleife=" /tmp/sources | sed s/§$schleife=//g)
sources=$(grep $sourcesname /tmp/sources2 | sed s/$sourcesname=//g)
sourcesz=$(expr $sourcesz + 1)
echo "$sourcesname§$sources" >> ~/.jdcvs/sources
fi
schleife=$(expr $schleife - 1)
done
rm /tmp/sources
rm /tmp/sources2
echo -e "$sourcesz $(grep "§79=" ~/.jdcvs/lang/$lang | sed s/§79=//g)\n"
exit
fi
Die /tmp/discr sieht dann ungefähr so aus:
entries=33
§33=multisync
§32=atlantik
§31=krecipes
§30=fhp
§29=feta
§28=epiphany
...
Geht dann natürlich bis §1 weiter.
Die /tmp/discr2 sieht dann so aus:
entries=33
kdebluetooth=The KDE Bluetooth Framework is a set of tools built on top of Linux\' Bluetooth stack BlueZ
multisync=MultiSync is a program to synchronize calendars, addressbooks and other PIM data between programs on your computer and other computers, mobile devices, PDAs or cell phones.
atlantik=Atlantik is the leading open-source game client for Monopoly®-like board games to be played on the monopd network.
krecipes=Krecipes is a new Open Source project for an exciting world that is almost forgotten in the Tux world: COOKING (yummy! ;-)
gcc=GCC is the GNU Compiler Collection, which currently contains front ends for C, C++, Objective-C, Fortran, Java, and Ada
Geht natürlich auch noch weiter.
Aber was ist daran nun falsch? Ich versteh das einfach nicht :(
Ohne Fehlermeldung - und auf der Konsole geht es ohne murren... :confused:
Also das ist der Teil von Bash Script:
if [ $1 = "--update" ]
then
cd /tmp/
#### Aktualisieren der discr ####
discrz=0
wget http://jdcvs.sourceforge.net/home/discr 2> /tmp/jdcvs-wget-discr >> /tmp/jdcvs-wget-discr
wget http://jdcvs.sourceforge.net/home/discr2 2> /tmp/jdcvs-wget-discr2 >> /tmp/jdcvs-wget-discr2
schleife=$(grep "entries=" /tmp/discr | sed s/entries=//g)
while [ $schleife != 0 ] 2> /dev/null
do
echo $schleife
#####################
#### HIER BLEIBT ER STEHEN!##
#####################
appsname=$(grep "§$schleife=" /tmp/discr | sed s/"§$schleife"=//g)
if [ $(grep -c $appsname ~/.jdcvs/discr) = 0 ]
then
discrname=$(grep "§$schleife=" /tmp/discr | sed s/§$schleife=//g)
discr=$(grep $discrname /tmp/discr2 | sed s/$discrname=//g)
discrz=$(expr $discrz + 1)
echo "$discrname=$discr" >> ~/.jdcvs/discr
fi
schleife=$(expr $schleife - 1)
done
rm /tmp/discr
rm /tmp/discr2
echo -e "\n$discrz $(grep "§77=" ~/.jdcvs/lang/$lang | sed s/§77=//g)"
#### Aktualisieren der sources ####
cd /tmp
sourcesz=0
wget http://jdcvs.sourceforge.net/home/sources 2> /tmp/jdcvs-wget-sources >> /tmp/jdcvs-wget-sources
wget http://jdcvs.sourceforge.net/home/sources2 2> /tmp/jdcvs-wget-sources2 >> /tmp/jdcvs-wget-sources2
schleife=$(grep "entries=" /tmp/sources | sed s/entries=//g)
while [ $schleife != 0 ]
do
if [ $(grep -c $(grep "§$schleife=" /tmp/sources | sed s/§$schleife=//g) ~/.jdcvs/sources) = 0 ]
then
sourcesname=$(grep "§$schleife=" /tmp/sources | sed s/§$schleife=//g)
sources=$(grep $sourcesname /tmp/sources2 | sed s/$sourcesname=//g)
sourcesz=$(expr $sourcesz + 1)
echo "$sourcesname§$sources" >> ~/.jdcvs/sources
fi
schleife=$(expr $schleife - 1)
done
rm /tmp/sources
rm /tmp/sources2
echo -e "$sourcesz $(grep "§79=" ~/.jdcvs/lang/$lang | sed s/§79=//g)\n"
exit
fi
Die /tmp/discr sieht dann ungefähr so aus:
entries=33
§33=multisync
§32=atlantik
§31=krecipes
§30=fhp
§29=feta
§28=epiphany
...
Geht dann natürlich bis §1 weiter.
Die /tmp/discr2 sieht dann so aus:
entries=33
kdebluetooth=The KDE Bluetooth Framework is a set of tools built on top of Linux\' Bluetooth stack BlueZ
multisync=MultiSync is a program to synchronize calendars, addressbooks and other PIM data between programs on your computer and other computers, mobile devices, PDAs or cell phones.
atlantik=Atlantik is the leading open-source game client for Monopoly®-like board games to be played on the monopd network.
krecipes=Krecipes is a new Open Source project for an exciting world that is almost forgotten in the Tux world: COOKING (yummy! ;-)
gcc=GCC is the GNU Compiler Collection, which currently contains front ends for C, C++, Objective-C, Fortran, Java, and Ada
Geht natürlich auch noch weiter.
Aber was ist daran nun falsch? Ich versteh das einfach nicht :(
Ohne Fehlermeldung - und auf der Konsole geht es ohne murren... :confused: