[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: scripting question

On Wed, 16 Apr 2003, Colin Watson wrote:

> On Tue, Apr 15, 2003 at 07:23:06PM -0700, Alvin Oga wrote:
> > -- and be careful, that what you type on a command line will NOT
> >    necessarily work in a bash script
> > 
> > 	root#  ls -la /home/foo  | grep -iv "ignore|this|and|that" 
> > 
> > 	will need to be 'escaped' in some scripts and not others
> That's wrong just to start with. Use egrep if you want to use '|' for
> alternatives. With grep, use '\|', and put single quotes around it, not

yupp ... typo on grep...

> double. Double quotes are asking for trouble unless you explicitly want
> their expansion effects.

yup.. i usually define $EXCLUDES as a variable someplace else ...

and worst i like to echo the cmd before executing it in the script ...
adds more fun .. esp w/ "|" floating around 

c ya

Reply to: