PATH für alle User ändern

A

auto01

Aktives Mitglied
Thread Starter
Dabei seit
20.10.2004
Beiträge
125
Reaktionspunkte
3
Hallo!
Wie kann man dauerhaft für alle User die PATH-Variable anpassen? Es sollte also schon beim Start der PATH neu exportiert werden.
Für einen USER würde ich folgendes in eine ".profile" Datei im HOME-Verzeichnis schreiben.
export PATH=/opt/home/bin:$PATH
Nur wo muss man das rein schreiben, damit das beim Start für alle USER gemacht wird?
Betriebssystem ist 10.5-Server.
 
Moin!

Das könntest Du in die Datei "/etc/profile" schreiben.

Christian
 
Kommt grundsätzlich zuerst einmal darauf an, welche Shell Du verwendest und wie sie gestartet wird. Details findest Du in der manpage der jeweiligen Shell.
Für die bash ist /etc/profile ein guter Ansatz.
Details zum Thema für die bash:
Code:
man bash | less +4/INVOCATION

Auf meiner Website gibt es auch einen Artikel zu dem Thema.
 
Das könntest Du in die Datei "/etc/profile" schreiben.
Es ist NICHT ratsam, in eine Datei etwas hineinzuschreiben, in der man nichts zu suchen hat. Beim naechsten OS X Update koennten die Inhalte weg sein weil Apple entschieden hat die Datei zu "ersetzen". Besser ist es Mechanismen zu nutzen, die Dateien einsourcen und das System flexibel erweitern:

Code:
path_helper(8)            BSD System Manager's Manual           path_helper(8)

NAME
     path_helper -- helper for constructing PATH environment variable

SYNOPSIS
     path_helper [-c | -s]

DESCRIPTION
     The path_helper utility reads the contents of the files in the directories /etc/paths.d and /etc/manpaths.d and appends their con-
     tents to the PATH and MANPATH environment variables respectively.

     Files in these directories should contain one path element per line.

     Prior to reading these directories, default PATH and MANPATH values are obtained from the files /etc/paths and /etc/manpaths
     respectively.

     Options:

     -c      Generate C-shell commands on stdout.  This is the default if SHELL ends with "csh".

     -s      Generate Bourne shell commands on stdout.  This is the default if SHELL does not end with "csh".

NOTE
     The path_helper utility should not be invoked directly.  It is intended only for use by the shell profile.

Mac OS X                        March 15, 2007                        Mac OS X

Code:
--(icehouse@osx)-(6/ttys002)-(15:29:01/23-May-08)--
--($:~)-- ls -l /etc/paths.d/
total 16
-rw-r--r--  1 root  wheel  13 Sep 24 04:53 X11
-rw-r--r--  1 root  wheel  15 Feb  5 12:36 apache2
--(icehouse@osx)-(7/ttys002)-(15:30:02/23-May-08)--
--($:~)-- cat /etc/paths.d/apache2 
/usr/local/apache2/bin/
Gruss von IceHouse
 
  • Gefällt mir
Reaktionen: cmittendorf
Danke für den Hinweis - men lernt wohl nie aus ;-)
 
Zurück
Oben Unten