Re: How to change shell valluables
Re: How to change shell valluables
- Subject: Re: How to change shell valluables
- From: Doug McNutt <email@hidden>
- Date: Tue, 28 Dec 2004 17:36:15 -0700
At 10:10 -0800 12/28/04, Justin Walker wrote:
>AFAIK, this file is not "truly global". No shell that I am aware of reads this file, and no command-line app knows about it. This file is used by the Finder, when it invokes a "double-clicked" Aqua app, to set up an environment in the same way that the shell sets one up for command-line apps. Also, most (or, at least, many) Aqua apps don't know about or use environment variables.
This is a copy of my environment.plist file. Note that is has grown over time to include some variables that I don't even remember putting there. Some were for testing these very points with the logging lines I write while in .tcshrc.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DOUG</key>
<string>Douglas P. McNutt</string>
<key>LANG</key>
<string>us_ENG</string>
<key>LC_ALL</key>
<string>C</string>
<key>PATH</key>
<string>/Users/doug/bin:/opt/local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin</string>
<key>RCCOUNT</key>
<string>0</string>
<key>SERVER_NAME</key>
<string>Earth</string>
<key>SHELLOG</key>
<string>/Users/doug/logs/shel_log</string>
<key>PROJ</key>
<string>/Volumes/Echo/Projects</string>
<key>BASH_ENV</key>
<string>/Users/doug/.bashrc</string>
<key>ENV</key>
<string>/Users/doug/.shrc</string>
</dict>
</plist>
The plist seems to be read at login-to-Aqua time. If you attempt to change a variable by editing the plist and then restarting an application from Finder or from a shell your changes are ignored. A logout and login (to Aqua) is required. It is more likely read by the login application than by Finder.
You cannot add items to a factory supplied PATH in a .plist file.
In Terminal (tcsh):
echo $DOUG -> Douglas P. McNutt
echo $PATH -> does find my specials but that may be from old code in ~/.tcshrc
In a BBEdit worksheet:
echo $DOUG -> Douglas P. McNutt
echo $PATH -> comes up the way I set it in the .plist.
In a freshly opened X11 window:
echo $DOUG -> Douglas P. McNutt.
echo $PATH -> adds /usr/X11R6/bin/ to the path in the .plist.
from an external login using telnet from my Linux box:
Is still on my todo list. Someday.
Telnetting to the Linux box from Terminal loses all Mac environment variables and I'm not surprised.
In AppleScript a "do shell script" request does honor my environment variables even though it now goes to bash rather than the tcsh I specify in my Aqua user options.
I didn't check right now but I believe my cron jobs use the SHELLOG variable successfully. They haven't been changed since Jaguar.
Apache honors the SERVER_NAME given in the plist though I haven't gone far with that and it's not running now.
--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden