
Hallo, Am Die, 26 Jun 2007, Steffen Genkinger schrieb:
Ich bin gerade dabei eine Rechnerumgebung bestehend aus Unix und SuseLinux Maschinen irgendwie zu vereinheitlichen und möchte nach Möglichkeit alles über die .bashrc abhandeln in der ich je nach Maschine und OS die entsprechenden Einstellungen vornehme. [..] Allerdings kann ich die aliase nicht in einem Skript verwenden. Ich habe da gerade schon gegoogelt, werde aber nicht richtig schlau draus. Es hat wohl etwas mit den Variablen $BASH_ENV oder auch $ENV zu tun. Ein erster Versuch mit einem export BASH_ENV= ~.bashrc
Was soll das Leerzeichen nach dem "="?
schlug allerdings fehl? Wie genau muss ich vorgehen, damit ich die alias-Definitionen auch in den bash-Skripten verwenden kann?
Wer lesen kann ist klar im Vorteil: ==== man bash ==== When an interactive shell that is not a login shell is started, bash reads and executes commands from ~/.bashrc, [..] When invoked as an interactive shell with the name sh, bash looks for the variable ENV, expands its value if it is defined, and uses the expanded value as the name of a file to read and exe cute. Since a shell invoked as sh does not attempt to read and execute commands from any other startup files, the --rcfile option has no effect. A non-interactive shell invoked with the name sh does not attempt to read any other startup files. When invoked as sh, bash enters posix mode after the startup files are read. ==== Ein Shellscript ist _nicht_ interaktiv... Und was steht in der ersten Zeile des Scriptes? Und welche Shell ist "/bin/sh"? Und Unix wird das normal keine Bash sein. Achso, sinngemäß sollte obiges auch in Übersetzungen stehen. Du könntest im Script die Alias-Datei sourcen. ==== #!/bin/bash . ~/.alias ==== HTH, -dnh -- If Windows is the solution, can we please have the problem back? -- 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