• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Save Terminal output as file or variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Adding files to a Folder Hierarchy
      • From: Steve Suranie <email@hidden>
References: 
 >RE: Save Terminal output as file or variable (From: "Jan-Bultereys" <email@hidden>)

  • Prev by Date: user/password in the script
  • Next by Date: Adding files to a Folder Hierarchy
  • Previous by thread: RE: Save Terminal output as file or variable
  • Next by thread: Adding files to a Folder Hierarchy
  • Index(es):
    • Date
    • Thread