[plt-scheme] process.ss can't find command
On Mar 11, Stephen De Gabrielle wrote:
> Hi,
>
> I'm not sure whats going wrong here, but I'm trying to use the system
> command supplied by
> (require scheme/system) or (require (lib "process.ss" "mzlib"))
>
> It seems to get a different version of $PATH on my osx machine
>
> this code;
> ;#lang scheme/base
> ;(require scheme/system)
> (require (lib "process.ss" "mzlib"))
> ;(system "svn add svn-commit.scm")
> (system "echo $PATH")
BTW, you can use (getenv "PATH")
> [...]
>
> I'm assuming that;
> 1. $PATH is [normally] the same for bash and /bin/sh
> ie
> $ /bin/sh
> sh-2.05b$ echo $PATH
> /opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
PATH is an environment variable, so when you run /bin/sh you simply
inherit whatever PATH you currently have. For example, if you change
it with
export PATH=/foo/bar:$PATH
then the subshell will have that two. The same applies for mzscheme
and drscheme -- you should see the same results if you replace `/bin/sh'
in these experiments with
mzscheme -e '(getenv "PATH")'
So, my guess is that you started DrScheme by double clicking its icon,
which gives you the set of paths in PATH that the Finder has.
Starting a terminal is probably adding a bunch of stuff like the
"/opt" and "/sw" things.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!