#!/bin/ksh
# Author:Dhana Lakshmi Date:Jan 15 2012
# Shell script to copy contents of mutiple files(file1,file2,file3)
#in to one single file(fileout)
# Below command is used here to delete the contents of destination file before copying source files
> fileout
#Copying multiple files and appending the contents one by one to fileout
cat file1 file2 file3 >> fileout
echo " files copy successful"
Save the above script as Appendfile.ksh
Execute using command sh Appendfile.ksh
Note: In the above script all source filenames are starting with similar string such as file*, we can use cat file* instead of cat file1 file2 file3.
Comments
Post a Comment