On Die, 01 Mai 2001, Sebastian Helms wrote:
* Marco_Jaeger schrieb am 01 May 2001:
die Variablen werden nicht gesetzt.
Du rufst das shell-script auf, richtig? Dann laeuft das script in einer subshell und _nur_ in dieser (und mittels export in den von dieser subshell aufgerufenen Programmen). Wenn du aber in der _aktuellen_ shell die Variablen setzen willst (und das willst du vermutlich) so musst du das script mittels source in der aktuellen shell ausfuehren. Also ~ $ source <script> oder auch: ~ $ . <script> siehe man bash.
bzw in einem alternativprog mit : ${XXX_HOME:=/usr/xxx} : ${XXX_BIN:=$XXX_BIN/bin} ... export XXX_HOME XXX_BIN ....
Das ist schon richtig so.
XXX_HOME=/usr/xxx XXX_BIN=$XXX_HOME/bin export XXX_HOME XXX_BIN
Ist nicht unbedingt was gewuenscht ist. Das : ${VARIABLE:=WERT} Aus man bash: ${parameter:=word} Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parame ter. The value of parameter is then substituted. Positional parameters and special parameters may not be assigned to in this way. Ist also die Variable schon gesetzt wird sie nicht geaendert. Die normale Version mit VARIABLE=WERT ueberschreibt evtl. gesetzte Werte. -dnh -- Today on Handyman's Corner, we're going to take some ordinary dice, some Bondo to fill in the holes, a Dremel tool with a pointy bit to carve the words "REBOOT", "RETRY", and "REINSTALL" in the faces, and a bit of paint to make it look pretty. ITWDFYHTSALFYH. [A. de Boer on adminning Win]