[wellylug] Shell script problem

Atom Smasher atom at smasher.org
Thu Nov 1 12:57:04 NZDT 2007


On Thu, 1 Nov 2007, michael at diaspora.gen.nz wrote:

>> EXCLUDES='--exclude="saswork/" --exclude="pagefile.sys" --exclude="*.tmp"'
>
> Try eliminating the single quotes here.  I suspect what is happening is 
> that $EXCLUDES is being passed as a single argument to rsync, and 
> rsync's argument parser is getting confused.
===========

eliminating the quotes would cause the first token after the first <space> 
to be interpreted as a command, which is not desired. the single quotes 
are needed to group multiple tokens (including double quotes and "*") in a 
variable.

i don't think that's the problem, but the way to test your theory is this, 
which includes backslashes:
EXCLUDES=--exclude="saswork/"\ --exclude="pagefile.sys"\ --exclude="*.tmp"


-- 
         ...atom

  ________________________
  http://atom.smasher.org/
  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
  -------------------------------------------------

 	"A function of free speech under our free system
 	 of government is to invite dispute. It may indeed
 	 best serve its high purposes when it induces a
 	 condition of unrest, creates dissatisfaction with
 	 conditions as they are, or even stirs people to anger."
 		-- Supreme Court Justice William O. Douglas
 			Terminiello v. Chicago (1949)





More information about the wellylug mailing list