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 Tue, 2005-03-01 at 07:46 -0800, Jeremy C. Reed wrote:
> 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.)

----
if you wanna be my guru - you have to be available when I need ya ;-)

Yes, we did go through that a few weeks ago and I am showing the signs
of CMSS (can't remember s**t syndrome)

but the problem wasn't there, it was with the do while `cat $infile` -
reading a line like
**** START of SECTION ****
was causing it to spasm.

but remembering the old joke about the guy who walks into his doctors'
office and says "Doc, it hurts when I do this" - to which the doctor
replies "Well don't do that" - I stopped doing that.

Craig

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