Am Don, 2003-05-01 um 00.21 schrieb Thorsten Haude:
Moin,
gibt es in C/POSIX einen Weg, die Loginshell des aktuellen Users herauszufinden? Mir ist kein direkter Weg dazu bekannt.
Auf 'getenv("SHELL")' will ich nur zurückgreifen, wenn es nicht anders geht, schon weil ich nicht sicher bin, ob alle Shells das setzen.
Dazu sagt SUSv3: SHELL This variable shall represent a pathname of the user's preferred command language interpreter. Zu shall wird folgendes gesagt: shall For an implementation that conforms to IEEE Std 1003.1-2001, describes a feature or behavior that is mandatory. An application can rely on the existence of the feature or behavior. For an application or user, describes a behavior that is mandatory. Stellt sich aber auch die Frage, wozu Du das ganze brauchst. /bin/sh und system gibt es immer. Ralf