Re: Fink and 'sh'
Re: Fink and 'sh'
- Subject: Re: Fink and 'sh'
- From: Walter Ian Kaye <email@hidden>
- Date: Mon, 22 Mar 2004 04:12:58 -0800
At 11:33a +0100 03/22/2004, Brennan didst inscribe upon an electronic papyrus:
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)
No, not those other words.
However, I can't seem to call 'where' with 'do shell script'.
What he meant by "do this in the shell" was "do this in your shell in
Terminal, and then hard-code the path into your 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'?
That would be pointless. `where` (or `which`) relies on the PATH
variable in order to locate the file, so you would have a catch-22
thingie or whatever.
-boo
pretending to know what he's talking about
_______________________________________________
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.