Re: bash scripts conditionals and substrings

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin
Date:  
To: PLUG-DISCUSS
Subject: Re: bash scripts conditionals and substrings
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").

...Kevin



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