[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Anmelden als Benutzer "lfs" in einem bash Skript



Mag. Leonhard Landrock wrote:

> Hallo Liste!
> 
> Ich versuche mich (wieder einmal) mit Linux from Scratch (LFS). Diesmal möchte 
> ich mir gleich mein eigenes Skript schreiben, dass den Erstellvorgang 
> automatisiert und alle Ereignisse und Fehler mitprotokolliert.
> 
> Kurzes Zitat aus "Linux From Scratch - Version SVN-20060707" Abschnitt "4.3. 
> Adding the LFS User":
> 
> "Next, login as user lfs. This can be done via a virtual console, through a 
> display manager, or with the following substitute user command: 
> 
> su - lfs
> 
> The “-” instructs su to start a login shell as opposed to a non-login shell. 
> The difference between these two types of shells can be found in detail in 
> bash(1) and info bash."
> 
> Meine Frage:
> --------------------
> 
> Wie erzeuge ich eine login shell in einem bash Skript so, dass das Bash Skript 
> nachher in dieser Shell weiter ausgeführt wird.
> 
> Genauer gesagt will ich sogar ein anderes Skript aus der login shell heraus 
> aufrufen. Hat aber nur mit einer Aufteilung der LFS Abschnitte auf mehrere 
> Skripte zu tun.

man su, Option -c

---snip---
OPTIONS
       -c, --commmand=<command>
              pass command to the invoked shell using its -c option
---snap---

sollte das tun, was Diu willst.

hth
Reinhold




Reply to: