Well, I’m back a couple of days later with another “do shell script” that fails. Of course, last time it actually worked, it was just my stupid code making it appear to partially fail. At least this actually fails with an error.
do shell script "/usr/local/bin/lftp -u ftpremote01,[password] -p 21 [IP Address] << \"EOF\"
pget -n 10 'Test/main.scpt'
bye
EOF"
So, if I paste the first line into the terminal and run it, then paste the second line into the terminal and run it, each works fine.
For the Applescript, I get:
It seems very odd to me the phrasing of the error, with “Test/main.scpt: /main.scpt” as if the second part of the path was passed again? Or maybe that’s just the format for the error from lftp, it shows the whole path, and then the name of the file?
I’m suspect something wrong with my heredoc, I’m not very experienced with shell. Just trying to blunder through.
I added the “-d” argument for more feedback, here’s what’s returned in case that’s helpful. (With the password and IP address redacted).
I don’t know if I’ve got a syntax error? That seems a lot more likely to me than that I somehow really don’t have permissions for this inside a “do shell script” when I do have them on the terminal.
Ah, one more thought. Maybe the lack of permission being reported isn’t server side, maybe it’s local side - running these commands in Terminal, the file comes down to my User folder. Maybe the script is trying to download it to whatever the “home folder” is for “do shell script,” which isn’t my user folder. I tried adding an lcd command to change the path lftp would download to, but with no luck. Whatever path I try to LCD to errors:
returns the error:
returns the error:
Where does a “do shell script” think it’s default directory path starts?
Any suggestions greatly appreciated.
Thanks,
t.spoon