MACSCRPT Archives

February 2009

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:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 19 Feb 2009 16:09:24 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (55 lines)
 Hi,

I have a script that builds a shell script for FTP via CURL.

The script works just fine when run on my machine and several other local
macs, but when installed on some remote macs the script fails.

On these remote macs the unix admins tell me that curl also fails in
terminal, but if they change the local directory first then run curl it
works.

So I have two questions: Can I emulate changing the local directory and
execute the CURL command in the same shell

and 

Why is this happening?

The meat of the script is below

Thanks

ES
------------

  set myFile to quoted form of POSIX path of myFile
  
  set ftpUploadScript to {"/usr/bin/curl"}
  set the end of ftpUploadScript to " ftp://"
  set the end of ftpUploadScript to myUserid
  set the end of ftpUploadScript to ":" & myPassword
  set the end of ftpUploadScript to "@" & myServer & myRemotePath
  set the end of ftpUploadScript to " -T"
  set the end of ftpUploadScript to myFile
  
  set ftpUploadScript to ftpUploadScript as text
  
  if debugging then
    tell application "Finder"
      activate
      display dialog ftpUploadScript default answer ftpUploadScript giving
up after 5
      set ftpUploadScript to text returned of the result
    end tell
  end if
  set upLoadoutput to do shell script ftpUploadScript
  if debugging then
    tell application "Finder"
      activate
      display dialog upLoadoutput & return & return & dirStdout giving up
after 5
    end tell
  end if
-----------

ATOM RSS1 RSS2