Bash Shell Script Part II
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Bash Shell Script Part II




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Bash Shell Script Part II  
Ashish


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-16-07 06: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.






[ Post a follow-up to this message ]



    Re: Bash Shell Script Part II  
Ben Bacarisse


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-07 12:24 AM

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.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:58 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register