Modify file with directory structure details

I need to take an existing file, an rpm spec file, and insert a list of files at a specific point.  The spec file will have something like this as the demarcation of where the file list needs to be inserted:
The script needs to take a directory and recursively identify all files under that directory and write each file, and its path, on a separate line in the rmp spec file.

What would be the best way to handle this?

Who is Participating?
nukeme369Connect With a Mentor Commented:
(the above is the script needed to generate the file list - working on the insert at %file part)
for filelist in *
do echo $workingdir"/"$filelist >>/tmp/rpmspecfile

Fairly self explanatory, but I'll walk through it.

Variable named workingdir is defined with the current directory as its data.
for loop - looping through each file in current directory.  
each file has the following happen:
the $workingdir variable is echoed, with a trailing /  then the current file is written to /tmp/rpmspecfile.

Repeat for every file in the current dir.

jkavxAuthor Commented:
If you can work out the insert at the specific file location piece, please add a comment with the details.  Thx.
All Courses

From novice to tech pro — start learning today.