Re: bash scripts conditionals and substrings

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Craig White
Date:  
To: plug-discuss
Subject: Re: bash scripts conditionals and substrings
On Mon, 2005-02-28 at 22:58 -0700, Kevin wrote:
> On Mon, 2005-02-28 at 22:43 -0700, Craig White wrote:
> > I now have in my tried and failed...
> >
> > #    if [ "START" == ${i:5:5} ]
> > #    if [ `echo $i | awk '{print substr($i,5,5)}'` = "START" ]
> > #    if [ `expr substr $i 5 5` == "START" ]

>
> As a test, try echoing ${$i:5:5} directly inside the 'do' structure
> without any "if" conditionals. Make sure it shows what you expect
> ("START").

---
actually I have and had confusing results but I did even better than
that

I did...

for i in `cat $infile`; do echo "$i"; done; exit

and the stupid sucker is gagging on the "*" in the $infile - it has
nothing to do with the conditionals whatsoever

Evidently when it assigns the line "**** START OF ..." it actually tries
to execute the first 4 files it finds in the directory - $#!%

I think I should clean pools for a living

;-)

Craig

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss