Shell Command and cURL
Mark Schonewille
m.schonewille at economy-x-talk.com
Tue Nov 22 21:51:05 EST 2016
It doesn't make sense to create a list of 140000-something files and try
to paste it somewhere. Instead, write a shell script that gets the file
list and download all files in the list.
Your script might look like this:
#!/bin/bash
$ curl -s ftp://user:pass@IP/path/to/folder/ | \
grep -e '^-' | awk '{ print $9 }' | \
while read f; do \
curl -O ftp://user:pass@IP/path/to/folder/$f; \
done
Save the script in a text file and do a chmod 755 on it to make an
executable file. Now let LiveCode launch the executable file. I think
the files will be downloaded to the defaultFolder or perhaps to the
location of the executable file .
If this is too much trouble, you might also save your current shell
command to a file and have LiveCode launch it.
Kind regards,
Mark Schonewille
http://economy-x-talk.com
https://www.facebook.com/marksch
Buy the most extensive book on the
LiveCode language:
http://livecodebeginner.economy-x-talk.com
Op 22-Nov-16 om 23:29 schreef Gregory Lypny:
> Hello everyone,
>
> I have never used LiveCode’s Shell command, and I was hoping that someone on the forum might be able to give me an example of how to use it with cURL to download a list of files from an FTP site. I have been using cURL to download many files at a time from a given directory by pasting the code into Terminal in OS X. The problem is that Terminal cannot handle a command that is too long. This limits me to pasting no more than about 500 file paths at a time, but I need to download about 145,000 files. That’s a fair bit of manual pasting. So if someone could give me an example of using the Shell command with cURL, I’d be much obliged.
>
> Regards,
>
> Gregory
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list