Re: Save Terminal output as file or variable
Re: Save Terminal output as file or variable
- Subject: Re: Save Terminal output as file or variable
- From: "Adam K. Wuellner" <email@hidden>
- Date: Mon, 6 Dec 2004 11:01:50 -0600
Additionally, you can execute shell scripts using the 'do shell script'
scripting addition, and bypass the Terminal.app, if you'd prefer. For
example:
set STDOUT to do shell script "snmpwalk -c public -v 1 192.168.16.234"
That line should not be placed inside a tell block. The variable
STDOUT will contain the output of the command. You can also use
standard UNIX I/O redirection (as suggested by Jan, below) with do
shell script, if you decide you'd rather send output to a file than a
variable.
Technical Note TN2065: do shell script in AppleScript:
<http://developer.apple.com/technotes/tn2002/tn2065.html>
On Dec 6, 2004, at 7:49 AM, Jan-Bultereys wrote:
this is how you put it into a file
do script "snmpwalk -c public -v 1 192.168.16.234" > testfile
do script "snmpwalk -c public -v 1 192.168.16.234" >> testfile (add
to the same file)
best regards,jan
----------
From:
applescript-users-
bounces+jan.bultereys=email@hidden on behalf of
Markus Zielonka
Sent: Monday, December 6, 2004 14:38 PM
To: email@hidden
Subject: Save Terminal output as file or variable
Hello NG,
i am a Newbi.
(* This is my first Script
Autor: Markus Zielonka
Version: 0.1
*)
tell application "Terminal"
do script "snmpwalk -c public -v 1 192.168.16.234"
end tell
I want to save the output in a file or variable.
The next step is to be dispatched the outputs by Chat
(ICQ or Jabber)
bye
Markus
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos - Hier
anmelden: http://mail.yahoo.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list
(email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden