How to concatenate all files. | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

How to concatenate all files.

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-22-2005
s80bob s80bob is offline
Registered User
 
Join Date: Aug 2005
Last Activity: 23 August 2005, 3:00 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old 08-22-2005
s80bob s80bob is offline
Registered User
 
Join Date: Aug 2005
Last Activity: 23 August 2005, 3:00 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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
<><
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Concatenate files bobby1015 Shell Programming and Scripting 3 02-24-2012 11:38 AM
Concatenate more than 200 files amarn UNIX for Dummies Questions & Answers 2 01-16-2012 02:27 PM
Concatenate files zhshqzyc Shell Programming and Scripting 6 02-19-2011 04:35 PM
Concatenate files mohanmuthu Shell Programming and Scripting 3 12-14-2010 09:49 AM
How to concatenate 2 files using awk? pdtak Shell Programming and Scripting 2 03-12-2008 01:12 PM



All times are GMT -4. The time now is 11:43 PM.