Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-14-2004, 08:59 AM   #1
LQ Newbie
Registered: Jul 2003
Posts: 7

Rep: Reputation: 0
Bash scripting question.

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.

Relevant data:

This is the portion of the script that searches for files:


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 gratly appreciated.

Old 01-14-2004, 10:05 AM   #2
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
echo Some_text | awk '{printf "\"%s\"", $0}'


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Scripting Question fiod Linux - Newbie 4 11-19-2005 05:09 AM
Bash scripting question ajaye1971 Linux - Newbie 1 11-16-2005 07:29 PM
Bash scripting question. pete1234 Programming 23 09-22-2005 06:52 PM
bash scripting question mehesque Programming 2 03-07-2004 01:37 PM
Bash Scripting Question RefriedBean Programming 6 09-11-2002 09:06 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration