Re: path to unix apps
Re: path to unix apps
- Subject: Re: path to unix apps
- From: "John W. Baxter" <email@hidden>
- Date: Sat, 17 Jul 2004 13:36:23 -0700
On 7/17/2004 9:15, "Andrew Oliver" <email@hidden> wrote:
>
Read the technote
>
>
http://developer.apple.com/technotes/tn2002/tn2065.html
>
>
> ... For security and portability reasons, do shell script ignores the
>
configuration files that an interactive shell would read, so you don't get the
>
customizations you would have in Terminal.
>
>
I haven't tried it, but presumably you could string the environment command
>
in your do shell script:
>
>
do shell script "PATH=/blah:/blah/blah:$PATH;command"
>
>
(using whatever syntax is appropriate for whatever shell 'do shell script'
>
uses nowadays).
>
>
Andrew
>
:)
>
>
On 7/17/04 9:00 AM, "Dieter May" <email@hidden> wrote:
>
>
> Hello,
>
>
>
> do shell script "echo $PATH"
>
> -->"/usr/bin:/bin:/usr/sbin:/sbin:/Users/dieter"
>
>
>
> gives me only this.
>
>
>
> I have some paths in /etc/profile and ~/.bashrc, in the Terminal I get
>
> this:
>
> /sw/bin:/sw/sbin:/ImageMagick-6.0.3/bin:/bin:/usr/bin:/usr/local/bin:/
>
> sbin:/usr/sbin:/usr/local/sbin:/Developer/Tools:/usr/local/vscanx:/opt/
>
> local/bin:/usr/X11R6/bin:/Users/dieter/bin
>
>
>
> Some unix apps do not work correctly even they are called with
>
> the full path e.g. /ImageMagick-6.0.3/bin/identify
>
>
>
> Is there a way to get more paths with the "do shell script"?
Once you know what is missing from the environment that the program is
running in, consider the env command. (It sounds in your example as if
ImageMagick makes an untoward assumption about some path or other
environment variable.)
Extracted from man env:
NAME
env - set and print environment
SYNOPSIS
env [-i] [name=value ...] [utility [argument ...]]
DESCRIPTION
env executes utility after modifying the environment as specified on the
command line. The option name=value specifies an environmental variable,
name, with a value of value. The option `-i' causes env to completely
ignore the environment it inherits.
If no utility is specified, env prints out the names and values of the
variables in the environment, with one name=value pair per line.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.