Re: bash scripts conditionals and substrings

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeremy C. Reed
Date:  
To: plug-discuss
Subject: Re: bash scripts conditionals and substrings
I know you said this was solved a different way. But anyways ...

Go back in the archives a couple weeks ago.

A single equal (=) is correct. See the test(1) man page.

Set a variable to your value first.

Then do something like:

value=`echo $i | awk '{print substr($i,6,6)}'`
if [ "x${value}" = "xSTART" ] ; then

(Notice 6,6 above also.)

Jeremy C. Reed

                 BSD News, BSD tutorials, BSD links
                http://www.bsdnewsletter.com/




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