A friend of mine wrote me this short script to run in terminal that downloads a particular file every n seconds from a password protectected FTP site. The script worked on his linux machine and on my Mac but not on my collegues Macs. I'm wondering if anybody knows reasons why it may be failing on other Macs.
We changing the first line from: #!/bin/sh to #!/bin/bash
and exceuting with
user_prompt_$ bash ./download_stats.sh
Another idea is to script cyberduck but it doesn't support applescript though may have a comand line interface (looking into that at present).
There error output from one of the accounts it fails on follows the script listing.
# Download XML_stats Bash Script
# Filename: download_stats.sh
# Arguments: input_filename - file to be downloaded from remote server. Optional.
# poll_interval - seconds delay between downloads. Optional (input_filename must be present)
# Use: Invoke from shell, e.g. ./download_stats.sh
# Author: Luke Neeson
# Date Created: 2012-05-31
# Comments: This script will download a given file, input_filename, at the given interval, poll_interval.
# - .netrc is required in the current directory and must contain the logon details for the fox server. This could be installed in the user home directory, if so, delete the line marked below.
# If the .netrc is in the directory of this script, the following must be enabled. If the user's home .netrc is to be used, comment out the following line:
if [ ! -z "$1" ] ; then
if [ ! -z "$2" ] ; then
while [ true ]
ftp access.foxsports.com.au << EOF 2>&1 | sed 's/.*AUTH GSSAPI.*//g' | sed 's/.*KERBEROS.*//g'
a-mbp:~ macca$ cd ~/stats/download_rugby_stats/
a-mbp:download_stats a$ sh download_rugby_stats.sh
: command not founds.sh: line 16:
: command not founds.sh: line 19:
: command not founds.sh: line 22:
download_stats.sh: line 39: syntax error: unexpected end of file
Those are the blank lines and 39 is the last line of script.