Posted: Wed Jan 03, 2007 5:38 am
For older versions of DS (where this functionality wasn't available) I use the following script. It takes a file pattern and echos all lines from all matching files with each line prefixed with the name of the source file:
(It might look a little weird in places as I've stripped out some funtionality specific to our installation, but it should still work fine.)
HTH,
J.
Code: Select all
#! /usr/bin/ksh
#------------------------------------------------
# Usage: getFiles.ksh {FilePattern}
#------------------------------------------------
FilePattern="$1"
if [ "$FilePattern" = "" ]
then echo "Must supply a file pattern"
exit 1
fi
# Iterate over files matching the supplied pattern
while [ "$1" != "" ]
do
# Get the filename
SetName=`echo $1`
# Iterate over each line of the file
cat $1 |
while read Job
do
echo "$SetName $Job"
done # read line (from file)
shift
done # read Filenames
HTH,
![Smile :)](./images/smilies/icon_smile.gif)
J.