The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-20-2008
snakernetb snakernetb is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 5
Unhappy list files and contents

I have a group of getOSinfo.out files that I would like to list the filename and then its contents out to. I can do it for each one individually, but would prefer to do it all in one shot and have one large file that has all of the oslevels and filenames. I am not very handy with scripts, so I was wondering if anyone had a script that did this already. It is on AIX so ksh is prefered, but I can probably tweak most things to work. I would like the output to look something like this:

Filename.out
content line 1
content line 2

You get the idea, I am still in my scripting infancy so please bare with me. Thanks for any help with this.

BTW this is what I was using, I know I will need a much more robust set of commands than this.

ls *.GetOSInfo.out > OSInfo.out | cat *.GetOSInfo.out >> OSInfo.out