LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2007, 12:30 PM   #1
dburesh
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Rep: Reputation: 0
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.

Last edited by dburesh; 07-24-2007 at 12:55 PM.
 
Old 07-24-2007, 08:39 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,245

Rep: Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327Reputation: 2327
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.
 
Old 07-25-2007, 09:20 AM   #3
dburesh
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the help....Thats all I needed!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ndiswrapper worked fine "ESSID:off/any" ??? cant put in an ssid?? fatrandy13 Linux - Wireless Networking 12 08-22-2011 12:32 AM
How can I put "Wave" music files on a AUDIO CD to play in my car? Balarabay1 SUSE / openSUSE 4 05-22-2006 11:19 PM
How do I put my entire system into "root", not just the konsole? GameGuru Linux - Newbie 11 07-04-2005 02:21 PM
C -communicating with system("ftp"); using "program|ftp>>myfifo" probably hansschmucker Programming 1 03-23-2005 02:39 PM
Judge finally tells SCO to "put up or shut up" Capt_Caveman General 5 12-07-2003 11:09 AM


All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration