Coomand Line in OSX [Was: Re: AppleScript and UNIX: Together at last!]
Coomand Line in OSX [Was: Re: AppleScript and UNIX: Together at last!]
- Subject: Coomand Line in OSX [Was: Re: AppleScript and UNIX: Together at last!]
- From: Greg Strange <email@hidden>
- Date: Sun, 25 Mar 2001 09:17:50 -0600
on 3/25/01 12:31 AM, email@hidden at email@hidden wrote:
>
Will we be able to use the command line from within scripts? Something like
>
>
tell app "terminal.app"
>
set x to pwd
>
if x = "/users/myself" then
>
cd ../
>
end if
>
set theFiles to ls as list
>
end tell
>
>
This would be awesome and incentivize my learning more Unixy stuff.
I just want to make the point here that given that we will now be given
truly UNIX alternative to run our scripts on, I would caution against using
the terminal.app for anything but the most difficult tasks for security
reasons. Giving your script access to the command line is an invitation to
danger at the least and an invitation to exploitation at the most. I have
not actually seen OSX yet so I don't know if you can do things like:
rm /*
from root and destroy your hard drive but if you "drop into the OS" you have
a potential exploit from within your AppleScript, especially as an ACGI.
Greg Strange
--
I made $500/week eating human flesh. Ask me how!