Computing.Net > Forums > Unix > adding date to ftp script...urgent

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

adding date to ftp script...urgent

Reply to Message Icon

Name: guru
Date: July 24, 2003 at 08:35:49 Pacific
OS: sun
CPU/Ram: sparc
Comment:

hi all,

This is regarding ksh script.

I have a ftp script which does fine job in copying files to remote server. But i still have a small problem to solve. Directories are been created in the server on basis of present day/month/year formats
/home/user1/(230703)
(ddmmyy) format.And i need to daily copy file automatically to that particular directory through ftp script.

I seen that,
dir='date +'%d0703'';$dir
220703
will give the exact day and format i require but...if I add $dir in ftp script it won't do any good
(e.g., cd /$HOME/user1/$dir
$dir will yield - date +'%d0703 and not 220703 .

Can anyone advise me what to do?




Sponsored Link
Ads by Google

Response Number 1
Name: ArnoldF
Date: July 24, 2003 at 17:54:48 Pacific
Reply:

too many ', not enough `
if you are using ksh, better alternative is:
date=$(date +'%d0703')


0

Response Number 2
Name: guru
Date: July 25, 2003 at 08:53:50 Pacific
Reply:

Thank you Arnold. :-)

Your suggession really helped me.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: adding date to ftp script...urgent

add date to filename www.computing.net/answers/unix/add-date-to-filename/4611.html

In script - how do I response to ftp err www.computing.net/answers/unix/in-script-how-do-i-response-to-ftp-err/2365.html

FTP Script - Win to Win www.computing.net/answers/unix/ftp-script-win-to-win/7721.html