The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: Combine file
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 03-02-2006
vgersh99's Avatar
vgersh99 vgersh99 is online now
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,162
Something to start with - you take it from here!
Code:
#!/bin/ksh

#file='Dummy.20060227.dat'

for file in *.dat
do
   nd="${file%.*}"
   name="${nd%%.*}"
   date="${nd##*.}"
   #echo "name->[${name}] date->[${date}]"
   cat "${file}" >> "combine.${date}.log"
done
Reply With Quote