Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-06-2004, 08:16 PM   #1
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?


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

All times are GMT -5. The time now is 06:25 AM.

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