Bash scripting - add a character to a line.
Occurred to me that I might have stuck this question in the wrong forum, so here it is again.
I use a script to generate a list of files for a backup process. The script find the files then ports the file names to a text file, which the rest of the script uses as a reference for the backup operation. Here is my problem:
The servers I'm backing up are a combination of Windoze and Novhell and both support long file names. When the script reads a long file name or directory with a space in it the file copy fails. I'm guessing that if I add quotation marks to the list of found files it will copy correctly, so the question is this: Can I have a script add quotation marks to the beginning and end of each line in a file? It can be done either as a separate script or, preferably, as part of my current script.
This is the portion of the script that searches for files:
find $SOURCE_PATH > $TEMP_FIND_FILE
cat $TEMP_FIND_FILE |\
while read FN; do
The "do" is a bunch of meaningless junk that will make no sense unless you have a DVD library.
A typical SOURCE file looks like this:
A typical "find" output looks like this:
I'd liek the output to look like this:
Any help would be greatly appreciated.