Quoting Axel Birndt <towerlexa@gmx.de>:
Dirk schrieb:
Quoting Axel Birndt <towerlexa@gmx.de>:
new="$1_$DATIME" # Ausgabe mit Echo als Kontrolle: echo $new
Ist denn bei dieser Lösung garantiert, dass $DATIME immer gleich ist? Also was ist wenn das Script sehr lange läuft und sich in der Zwischenzeit die Uhrzeit geändert hat?
Eigentlich sollte das ja kein Problem sein, da es keine Schleife ist, oder?
deshalb kannst Du ja am Beginn des Scriptes die Variable setzen, oder Du wählst einen anderen temporären Namen für Dein Ziel.
als da wären:
$$ PID Deines Scriptes.... siehe man bash und da "Special Parameters"
beantwortet das Deine Frage?
sorry wenn ich dich weiter belästige, aber du bist der einzige der bisher geantwortet hat :) Ich wollte zwar an die Liste senden, habe hier im Webfrontend nur die möglichkeit des Antwortens (komische sache das). Dieses Script wird von einem anderen System aus aufgerufen und soll dann die Dateien, die vorher von dem System aus gescpt werden verschlüsseln und per ftp übertragen. Also habe ich ja nur den Aufruf mit $1, da ich nicht wissen kann wie die Dateien heißen. Kann ich denn am Anfang des scriptes schon Variablen definieren, die ich nicht genau kennen kann? datime=date... neuedatei=$1_$datime neuedatei ergibt sich ja erst viel weiter unten, also nach dem mv? Ich habe immer gedacht, dass man das immer step by step machen muss? Bin da nich so der Crack :) danke dir aber schonmal, die erste Lösung geht schonmal, muss nur noch testen was passiert wenn 5 Prozesse das script aufrufen, dabei ist aber zum Glück $1 immer unterschiedlich. MfG Dirk -- Um die Liste abzubestellen, schicken Sie eine Mail an: opensuse-de+unsubscribe@opensuse.org Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken Sie eine Mail an: opensuse-de+help@opensuse.org
participants (1)
-
Axel Birndt