Re: Fink and 'sh'
Re: Fink and 'sh'
- Subject: Re: Fink and 'sh'
- From: Brennan <email@hidden>
- Date: Mon, 22 Mar 2004 11:33:53 +0100
On 21/3/04 at 17:45, steve harley <email@hidden> wrote:
>
on 21 Mar 2004, at 4:49 PM, Brennan wrote:
>
> I just installed 'LAME' with Fink. It works fine from the Terminal
>
> ('tcsh') but Applescript 'do shell script' is complaining that sh
>
> doesn't
>
> know the command 'lame'.
>
>
the sh process invoked by do shell script doesn't necessarily get the
>
same path settings you have set up for your normal shell.. the simplest
>
way to deal with this (and a good idea in general with do shell script)
>
is to specify the full path to the command you wish to invoke, such as
>
"/sw/bin/lame"
Many thanks to all who responded. I was beginning to realise that this was
the case, after examining Fink commander's prefs dialog. Can I hook up
'sh's search paths to look in /sw/bin/ ? How do I do that? I guess I have
to manually edit a prefs or plist file or something. (Ugh).
I'm a bit embarrassed to be asking what are certainly elementary
questions. Hmm. Just discovered this FAQ:
<
http://developer.apple.com/technotes/tn2002/tn2065.html>
It doesn't answer all my questions, but I will certainly digest as much of
it as I can understand.
On 21/3/04 at 19:50, Graff <email@hidden> wrote:
>
Try using the explicit path of the command. To find out where LAME is,
>
do this in the shell:
>
where LAME
>
>
It is probably located at /sw/bin/lame, so to use it do:
>
do shell script "/sw/bin/lame blah blah blah"
Hmm. In other words, the 'best' practice is probably something like this:
try
set lame to (do shell script "where lame")
on error msg number n
if n is -127 then -- UNIX command not found (i.e. not installed)
-- point user to source of command
display dialog "LAME not installed. Go on the net and get it?"
open location "
http://www.culater.net/osd/packages.html"
else
error number n
end if
end try
do shell script (lame & " " & myinputfile & " " & myoutputfile)
However, I can't seem to call 'where' with 'do shell script'. In terminal,
'where where' tells me that 'where' is built in to the shell.
Presumably 'where' is *not* built into 'sh', as evidenced by do shell
script "where where". Does 'sh' have an equivalent of 'where'?
Brennan
_______________________________________________
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.