The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to concatenate 2 files using awk? pdtak Shell Programming and Scripting 2 03-12-2008 10:12 AM
Script to concatenate several files docaia Shell Programming and Scripting 3 02-03-2008 06:07 AM
Concatenate text of two files in UNIX. Uniq UNIX for Advanced & Expert Users 1 01-19-2007 04:53 AM
Dvd files concatenate error: Not enough space maag SUN Solaris 3 05-06-2006 07:39 PM
Split n then concatenate files. praveen.pinto UNIX for Advanced & Expert Users 4 02-15-2005 09:50 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 08-22-2005
Registered User
 

Join Date: Aug 2005
Posts: 2
How to concatenate all files.

Hi, I'm totally new to Unix. I'm an MVS mainframer but ran into a situation where a Unix server I have available will help me. I want to be able to remotely connect to another server using FTP, login and MGET all files from it's root or home directory, logout, then login as a different user and do the same thing. I need to do this for 7 accounts. Each accounts home directory will have 0 or a number of files (but not more then about ten files). Once I'm done transfering all these files to a local directory, I'll want to concatenate all the transfered files into one large file for subsequent batch processing.

I thought I would write a Unix script to:
1) switch directories to a local working directory
2) remove any residual files in the local working directory
3) run FTP connecting and transferring files from 7 different accounts into the local working directory
4) concatenate all the transferred files to one large file.
5) run FTP again this time sending the one large file to an MVS mainframe.

My question is how do I accomplish item number 4? I was thinking I could use grep and pipe. I just want to concatenate all the files into one. The input filenames will be unknown, but I do want to specify the target filename.


Is this possibe? It has to be no?


Thanks in advance.
Bob
Reply With Quote
Forum Sponsor
  #2  
Old 08-22-2005
Registered User
 

Join Date: Aug 2005
Posts: 2
Maybe zazzybob's earlier post would work for me. He wrote this code earlier:

$ cd /path/to/files
$ files=*
$ cat $files > bigfile


So if I had several unknown file names in a local working directory I could copy them all to one big file with the above?


Bob
<><
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0