[aklug] Re: Linux certification

From: Damien Hull <damien@linuxninjas.tv>
Date: Tue Dec 01 2009 - 10:55:25 AKST

Thanks for the examples. I haven't had a chance to look at any bash scripti=
ng yet. I should have time this weekend.

Umm... What's up with those expressions? I don't get them, regular or other=
wise. Guess I'll learn once I start reading about shell scripting. In case =
anyone is confused it's the stuff inside the brackets.=20

     [ "$TEST" =3D3D "yes" ]

----- Original Message -----
From: "Leif Sawyer" <lsawyer@gci.com>
To: aklug@aklug.org
Sent: Monday, November 30, 2009 4:12:39 PM GMT -09:00 Alaska
Subject: [aklug] Re: Linux certification

Mike Tibor writes:
> Using those examples I would then write simple little scripts
> to verify that my understanding of something was correct.
> For example, for if/then things I might've done something like:
>
> #!/bin/sh
> TEST=3D3D"yes"
> #TEST=3D3D"no"
> if [ "$TEST" =3D3D "yes" ]; then
> =C2=A0 =C2=A0 echo "Yes"
> else
> =C2=A0 =C2=A0 echo "No"
> fi

or, for a fun bashism:

#!/bin/bash

TEST=3D3D"Oh, yes, please"
if [ -z "${TEST##*yes*}" ]; then
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0echo "Yes"
else
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0echo "No"
fi

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.

--=20
Ubuntu User
Open Source Evangelist
CERTIFICATIONS
linux professional institute level 1, CCENT
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Dec 1 10:56:02 2009

This archive was generated by hypermail 2.1.8 : Tue Dec 01 2009 - 10:56:02 AKST