Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp script using cat

Status
Not open for further replies.

tradntele

Programmer
Nov 7, 2001
14
US
Need help troubleshooting why my ftp script doesn't work. Previous threads suggested a script like the following to ftp a file that has a filename with yesterday's date.

First, this 11:59pm script creates a file with the appropriate date...

date +%m-%d-20%y > /sasuser/leexjx4/prod/yday.txt

Then the following 12:01am script references yday.txt to ftp the appropriate file...

ftp << EndFTP
open jan
ascii
prompt
get filename_`cat yday.txt`
close
EndFTP

The problem is I get a &quot;cannot open yday.txt&quot; error. Any ideas? I seem to recall while testing, that it did in fact work at some point. Now in a crontab, it results in the error.
 
Disregard... figured it out... the script was basically looking in the wrong directory for the cat file. Who would've thought you had to look in the right place!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top