|
Home > Archive > Unix Programming > August 2007 > Bash Shell Script Part II
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Bash Shell Script Part II
|
|
| Ashish 2007-08-16, 1:23 pm |
| Hello friends,
Thanks so much for your help on the last issue. I have another
issue...
The script I wrote finds a file that has a filename which contains
today's date in a particular format. I haven't done this yet, but I
also need to pass on the local addresses of these files to a null
program.
The problem I have is that the file will not fully download. I have
pasted the script and the text from my Terminal window.
Here's the script:
#! /bin/sh
FORMDATE=`date '+%Y%m%d'`
echo "The date is $FORMDATE"
ftp <<**
open ftp.m-qube.com
prompt off
mget *$FORMDATE.csv
mget *$FORMDATE
bye
**
Terminal:
Remote system type is UNIX.
Using binary mode to transfer files.
Interactive mode off.
Bad EPRT protocol.
Interactive mode off.
local: deactivation_file-20070816 remote: deactivation_file-20070816
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for deactivation_file-20070816
(0 bytes).
0 0.00 KB/s
226 File send OK.
221 Goodbye.
| |
| Ben Bacarisse 2007-08-16, 7:24 pm |
| Ashish <KundraInc@gmail.com> writes:
> Hello friends,
>
> Thanks so much for your help on the last issue. I have another
> issue...
>
> The script I wrote finds a file that has a filename which contains
> today's date in a particular format. I haven't done this yet, but I
> also need to pass on the local addresses of these files to a null
> program.
>
> The problem I have is that the file will not fully download. I have
> pasted the script and the text from my Terminal window.
>
> Here's the script:
>
> #! /bin/sh
>
> FORMDATE=`date '+%Y%m%d'`
>
> echo "The date is $FORMDATE"
>
> ftp <<**
> open ftp.m-qube.com
> prompt off
> mget *$FORMDATE.csv
> mget *$FORMDATE
> bye
> **
I am not going to answer you question -- I don't know what is
wrong! -- but I would suggest that you switch to using a command line
tool like wget. It is *designed* for scripting network operations and
cab do "globbing". If it suits, is likely to be much simpler than
driving an interactive program with a here-document.
<snip>
--
Ben.
|
|
|
|
|