AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:
CFG:
PT:0
S:andy.sharp@lsi.com
RQ:
SSV:mhbs.lsil.com
NSV:
SSH:
R:<Ed.Kwan@lsi.com>
MAID:2
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/LSI/INBOX	0	2B044E14371DA244B71F8BF2514563F5042E672B@cosmail03.lsi.com
X-Sylpheed-End-Special-Headers: 1
Date: Fri, 18 Dec 2009 10:59:16 -0800
From: Andrew Sharp <andy.sharp@lsi.com>
To: "Kwan, Ed" <Ed.Kwan@lsi.com>
Subject: Re: please review code change for TED 27867 Using "*" in vscan
 extension causes syntax error in SGA
Message-ID: <20091218105916.71178d85@ripper.onstor.net>
In-Reply-To: <2B044E14371DA244B71F8BF2514563F5042E672B@cosmail03.lsi.com>
References: <2B044E14371DA244B71F8BF2514563F504280553@cosmail03.lsi.com>
	<20091217170337.7b57b629@ripper.onstor.net>
	<2B044E14371DA244B71F8BF2514563F5042805A1@cosmail03.lsi.com>
	<20091217181137.3ae175a7@ripper.onstor.net>
	<2B044E14371DA244B71F8BF2514563F5042E672B@cosmail03.lsi.com>
Organization: LSI
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 17 Dec 2009 23:23:44 -0700 "Kwan, Ed" <Ed.Kwan@lsi.com> wrote:

> My mistake on my last response.  I don't have any .pdf file in my
> current directory. But, I think we're investigating a moot point.
> 
> Here's the original code:
> 
>     647             rc=`expr "$line" : '<rtCode>\(.*\)</rtCode>'`
>     648
>     649             if [ "$rc" == "" ]
>     650             then
>     651                 echo -E "$line" >> $TMPFILE
>     652             else
>     653                 return $rc
>     654             fi
> 
> "return" can only take a number as argument.  So it cannot be * or
> anything like that.

The shell will expand the '*' if it can.  what return does after that,
I don't know, but I worry that it won't be what we want.  'Sall I'm
sayin.

> 
> -----Original Message-----
> From: Kwan, Ed 
> Sent: Thursday, December 17, 2009 9:32 PM
> To: Sharp, Andy
> Subject: RE: please review code change for TED 27867 Using "*" in
> vscan extension causes syntax error in SGA
> 
> I get different results than you!?
> 
> [edk@edk-linux /tmp]$ ./s
> <rtCode>*.pdf</rtCode>
> rc not NULL *.pdf
> 
> 
> -----Original Message-----
> From: Andrew Sharp [mailto:andy.sharp@lsi.com] 
> Sent: Thursday, December 17, 2009 6:12 PM
> To: Kwan, Ed
> Subject: Re: please review code change for TED 27867 Using "*" in
> vscan extension causes syntax error in SGA
> 
> I'm not sure I understand what you're trying to tell me.  It seems to
> be able to absorb a single star all by itself.  Which actually
> surprises me a little bit.  But I guess once it sees the colon it's
> OK.
> 
> This is what worries me:
> 
> 
> ripper:~$ ./s
> <rtCode>*.pdf</rtCode>
> rc not NULL C-standard.pdf ReleaseNotes-4.0.0.pdf SB-1_WP100-R.pdf
> Velocity1000_DS_0409.pdf dmv-plate-replacement.pdf ds_755p_sprint.pdf
> milestone-summary-tuxrx.pdf mips_asm_prog_guide.pdf
> onstor_directory.pdf perforce_introduction.pdf sequoia.pdf
> treo_755p.pdf udev-persistent-naming.pdf window_estimate.pdf
> 
> 
> 
> 
> On Thu, 17 Dec 2009 18:45:43 -0700 "Kwan, Ed" <Ed.Kwan@lsi.com> wrote:
> 
> > The problem is "*" is an operator to expr.
> > Not related to expanding "*".
> >  
> > [edk@edk-linux /tmp]$ cat s
> > #!/bin/sh
> > 
> > read -r line
> > rc=`expr " $line" : ' <rtCode>\(.*\)</rtCode>'`
> > if [ "$rc" == "" ]
> > then
> >         echo -E "$line"
> > else
> >         echo rc not NULL $rc
> > fi
> > 
> > [edk@edk-linux /tmp]$ ./s
> > a
> > a
> > 
> > [edk@edk-linux /tmp]$ ./s
> > *
> > *
> > 
> > [edk@edk-linux /tmp]$ ./s
> > <rtCode>junk</rtCode>
> > rc not NULL junk
> > 
> > 
> > -----Original Message-----
> > From: Andrew Sharp [mailto:andy.sharp@lsi.com] 
> > Sent: Thursday, December 17, 2009 5:04 PM
> > To: Kwan, Ed
> > Subject: Re: please review code change for TED 27867 Using "*" in
> > vscan extension causes syntax error in SGA
> > 
> > On Thu, 17 Dec 2009 16:06:52 -0700 "Kwan, Ed" <Ed.Kwan@lsi.com>
> > wrote:
> > 
> > > Change 34063
> > 
> > 
> > = Change 34063 by edk@edk-dev on 2009/12/17 15:05:47 *pending*
> > = 
> > = 	For TED 27867 Using "*" in vscan extension causes syntax
> > error in SGA = 	Added an "X" in the string pattern so that
> > "expr" doesn't get confused. = 	Reviewed by
> > = 
> > 
> > nfx-tree/code/ssc-support/support.sh
> > 
> >      i don't think will do what you want, because the '*' might
> > still be in $rc, where it might get expanded in line 653.  also, i
> > don't understand why this does anything to help expr.  maybe you
> > just need double quotes around the `expr foo` part to keep the '*'
> >      from expanding.  and on line 653.  testing?
> > 
