[wellylug] Shell script problem

Atom Smasher atom at smasher.org
Thu Nov 1 13:13:33 NZDT 2007


On Thu, 1 Nov 2007, John Fouhy wrote:

> If I drop the single quotes and escape all the spaces (replace ' ' with 
> '\ ' in the EXCLUDES lines), then it works.
>
> So I guess that is solved.  I'm glad there was a logical explanation for 
> what seemed to me very illogical behaviour.  Thanks for your help, Atom 
> and Michael.
====================

if you want to keep it more readable without the backslashes, try this:

EXCLUDES='--exclude="saswork/" --exclude="pagefile.sys" --exclude="*.tmp"'
EXCLUDES=$EXCLUDES ## gobble up single quotes as needed above

for more info on what's happening, read the docs for the shell you're 
using and look for "field splitting".


-- 
         ...atom

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

 	"It is dangerous to be right
 	 when the government is wrong."
 		-- Voltaire





More information about the wellylug mailing list