OSProcess path?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

OSProcess path?

Brian Brown-2
Hello all,

Is there a way to set the path that OSProcess/CommandShell will use  
by default? For example, the path present in my login environment  
doesn't seem to be used.

I'm using MacOSX and OSProcess 4.0.1

Thanks!

Brian

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess path?

David T. Lewis
On Thu, Oct 26, 2006 at 04:26:52PM -0600, Brian Brown wrote:
> Hello all,
>
> Is there a way to set the path that OSProcess/CommandShell will use  
> by default? For example, the path present in my login environment  
> doesn't seem to be used.
>
> I'm using MacOSX and OSProcess 4.0.1
 
Brian,

You can set $PATH with "OSProcess accessor putPath: '/bin:/usr/bin:/foo/bar'".
This sets the PATH environment variable for the unix process in which the Squeak
VM is running.

You can access it with "OSProcess thisOSProcess path" but I note that there is
a bug here, the environment cache is not updated so you have to get the updated
value with "OSProcess thisOSProcess getEnvironmentDictionary at: #PATH".

A Squeak Shell (CommandShell) uses your Squeak default directory as its "home"
directory. The parser for the command shell does not emulate unix shell variables,
so "$HOME" does not get expanded. You can see the actual $HOME variable in a
Squeak Shell using a unix command such as "$ env | grep HOME". If you set the
PATH as described above, you can verify its value with a Squeak Shell command
"$ env | grep PATH".

The "home" directory for a Squeak Shell is set in CommandShell>>workingDirectory.
You can change this if you don't like the default behavior. For example, instead
of defaulting to "FileDirectory default pathName", you could have the default
working directory be "OSProcess thisOSProcess environment at: #HOME".

Dave