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

Re: Debian Testing und Systemshell dash



Robert Grimm wrote:
> Bernd Schmelter <benn@chefe.dyndns.org> wrote:
>> jo. /etc/profile wird aber auch von dash benutzt, wenn nix anderes im
>> Userhome.  Da dürfte also so ein Prompt "h:\w\$" in der Form gar nicht
>> erscheinen.  [...]
>
> Wann wird /etc/profile benutzt?

imho, wenn keine Loginscripts im Homeverzeichnis des Users vorhanden
sind. man dash sagt mir, dass in diesem Fall /etc/profile verwendet wird.

----
When first starting, the shell inspects argument 0, and if it begins with a dash ?-?,
the shell is also considered a login shell.  This is normally done automatically by
the system when the user first logs in.  A login shell first reads commands from
the files /etc/profile and .profile if they exist.  If the environment variable ENV
is set on entry to an interactive shell, or is set in the .profile of a login shell,
the shell next reads commands from the file named in ENV.
----

> Wenn du su - $user verwendest, wirst du fesstellen, das alles so ist,
> wie es sein soll.

Ja, so funktionierts tatsächlich. Mal mit einem anderen Systemuser getestet. :-)

----
serv:~# su irc
\h:\w$ exit                                                             #..und set
zeigt--> PS1='\h:\w\$ '
serv:~# su - irc
Kein Verzeichnis, Anmeldung mit HOME=/     #..und set zeigt--> PS1='$ '
$
----

>> Danke, habs für den amavis-user geändert. Hin und wieder nutze ich den,
>> um eine durchgerutschte Spammail als Spam zu "relearnen"
>
> Sollte amavis-user shell scripts verwenden, wäre für das interaktive
> Arbeiten su -s /bin/bash $user wohl günstiger.

Ja, und ich habe auch noch mal  man su  gelesen und weshalb das alles so
ist.


Danke

Benn



Reply to: