MACSCRPT Archives

June 2006

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"John A.M. Darnell" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 7 Jun 2006 14:14:40 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (77 lines)
Ed:

   I took a quick look at my Perl and PHP scripts that I execute using the 
"do shell script" command, and I found that in either case, I had prefaced 
the script with some kind of prep line.  For example in Perl it was 

#$/usr/bin/perl -m

and in PHP it was something like this:

<?

Be advised that I am really inexperienced in either scripting package, but 
maybe you need something similar, like "#bash" or whatever.

R,

John A.M. Darnell
Project Leader
Internal Software Development
Walsworth Publishing Company
John may also be reached at johnamdarnell (at) gmail dot com

Trivia question:  In the Lord of the Rings, who is the Lord of Imladris? 
For extra credit, by what other name is that place called?  The Lord of 
Imladris is Elrond, son of Earendil, a man, and Elwing, an elf.  Imladris 
is also known as Rivendell.



"Stockly, Ed" <[log in to unmask]> 
Sent by: Macintosh Scripting Systems <[log in to unmask]>
06/07/2006 01:00 PM
Please respond to
Macintosh Scripting Systems <[log in to unmask]>


To
[log in to unmask]
cc

Subject
do shell vs. tell terminal






I've got a shell script that I've been using on a server that's called by 
intellitune after a photo is processed. It needs to FTP a file to a 
specific address. (This is all internal, behind our firewall and security 
is not a big concern.)

If I type the script in to the terminal it works, which is good, because 
that's also how I'm learning shell scripting and debugging these scripts.

The problem is that if I run the identical command in a "do shell script 
foo" it fails. As a workaround I'm using terminal, but I'd prefer to not 
call up another app and would prefer to just run it as a do shell script. 
Is this doable? Is there a way to make the do shell script and terminal 
run consistently?

Here's the script I'm having trouble with:

set ftpShellScript to "ftp -d -v -u ftp://" & remoteUserid & ":" & 
remotePassword & "@" & remoteServer & ":21" & remotePath & fileName & " " 
& localFile

tell application "Terminal"
                 do script ftpShellScript
                 delay 3
                 set shellScriptLog to contents of window 1
end tell

Ed 

ATOM RSS1 RSS2