./test: line 2: [: too many arguments

E

-eraz-

Tripel-As
Kann mir jemand sagen warum er hier meckert?

Code:
MESSAGE=$(tail -n1 *.log)
if [ $MESSAGE = "Export terminated successfully without warnings." ]; then
        echo "Datenbank wurde erfolgreich exportiert am `date`" >> DB_Exports_ok.info
        rm -f *.dmp *.log 
else
        echo "Datenbank wurde am `date` mit Fehlern exportiert!" >> DB_Exports_fehler.info
fi

thx
;)
 
Bin zwar kein sh Scripter aber soweit ich in der Dokumentation sehen kann, ist hier

Code:
if [ $MESSAGE = "Export terminated successfully without warnings." ][B];[/B] then

das ";" fehl am Platz oder?
 
Code:
if [ "$MESSAGE" == "Export terminated successfully without warnings." ]; then
So sollte es gehen. Um $MESSAGE müssen noch " drum.

//edit
ich gehe dabei von Bash aus.
 

Ähnliche Themen

Queue für copy Script

Problem mit HSPA+ Modem Huawei E353 - Installation unmöglich?

Variableninhalt wird nicht gespeichert

Windows clients können nicht mehr auf lange laufendes System zugreifen

dovecot und postfix Konfiguration Problem

Zurück
Oben