ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
Quoting the filenames may not work in all cases. An easy way would be to change your script a bit and set the Internal Field Seperator (IFS) varaible to just include a newline. By default IFS is a newline and whitespace characters like tab and space.
Here is something that should work. Note that there can be no space after the IFS='
for FN in `find $SOURCE_PATH`; do
# meaningless junk here