LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux FTP and "Put" (https://www.linuxquestions.org/questions/linux-newbie-8/linux-ftp-and-put-571915/)

dburesh 07-24-2007 12:30 PM

Linux FTP and "Put"
 
Hello
I am trying to upload a text file by running a batch file that moves a file from my system to an as/400 server. The problem I am having is the batch file needs to execute everyday but the file being uploaded changes everyday. My program that I developed writes a text file where the first line is the name of the file to be uploaded. This file will change as the date changes. Ex.

ccf0_0711070138.csv - Day one
ccf0_0712070138.csv - Day two

I need a command that can read this text file(which will only contain the one line -the filename) and use this name for the "put" command.

i believe it is --- put <variable> <variable>

So the <variable> areas will change from day to day based on what gets written to that text file. If you could help me that would be great.

More or less i need a command that can read the text file and input that text into a command.

chrism01 07-24-2007 08:39 PM

If the filename file only contains one line you could go with:
file_to_put=$(cat file_containing_name)

If it's the first line
file_to_put=$(head -1 file_containing_name)

Last line
file_to_put=$(tail -1 file_containing_name)

then use that variable in the rest of your script.

dburesh 07-25-2007 09:20 AM

Thanks for the help....Thats all I needed!!!


All times are GMT -5. The time now is 01:16 AM.