LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-06-2004, 07:16 PM   #1
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Rep: Reputation: 30
Issue with recursive script passing arguments


I am writing a backup script for my server that calls itself recursively in each subdirectory. In doing so, it uses variables as the arguments and the problem I'm encountering is when directories have spaces. If I put double quotes around the variable names, they still are seen as multiple arguments if they have spaces in them. Basically, this is the recursive line in the script...

$0 "$target/$subdir" "$source/*"

So, if $target or $subdir has a space, then "$target/$subdir" will be seen as multiple arguments. Same with $source and "$source/*". Can anyone tell me how to use these variables in such a way that they will be seen as a single argument by the recursively called script?
 
  


Reply


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
Passing arguments to a shell script subu_s Programming 3 09-02-2005 05:13 AM
Problem with passing arguments in Perl bahadur Programming 1 05-30-2005 01:47 AM
Passing Arguments into the Thread Function George_gk Programming 2 01-31-2005 05:03 AM
Apache passing arguments to a shell script disabled? mikeyt_333 Linux - Security 3 08-03-2004 06:09 PM
Handline passing arguments in C AMMullan Programming 9 03-22-2004 01:37 AM


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

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