You simply set the variable to the do shell script command like this.
Code:
set myApplications to do shell script "ls /Applications/"
By default the returned myApplications variable result is a Applescript text type, as UTF-8 format, but you can use different types like this.
Code:
set theBinaryData to do shell script ("curl " & quoted form of theURLvariable) as data
this will return binarydata.
If you dont have Administrator privileges, you can use a command like this.
Code:
set myApplications to do shell script "ls /Applications/" with administrator privileges ¬
user name "adminName" password "adminPassword"
To find out all of the options for the do shell script command, look in the
StandardAdditions.sdef file, from the Window / Library menu.
Also you can script the Terminal Application like this.
Code:
tell application "Terminal"
activate
do script "ls /Applications/"
end tell
In all of the above examples, you can also use echo and pipes in your shell commands.
Hope this is of some help
Regards Mark