Re: PATCH: new 'if' primitive
Steve Kemp <[email protected]> Wed, 22 Oct 2008 10:39:19 +0100
| Newsgroups | gmane.comp.gnu.screen |
|---|---|
| Message-ID | <20081022093919.GB634__18250.9498823949$1238089114$gmane$org@steve.org.uk> |
On Tue Oct 21, 2008 at 16:34:55 -0700, Micah Cowan wrote:
> > if $FOO -eq "bar" ..
>
> In usual shell that would be =, not -eq (-eq is for numbers; the reverse
> of Perl).
D'oh. Updated now to treat "-eq" as numerical, and "=" as string.
> It'd also be nifty to support $(...) as well. But that's not crucial.
Sure.
> Also, I'm guessing we're not going to do string interpolation; that is,
> unlike shell,
>
> if $FOO = "foo bar"
That will actually work as expected as the Parse function does the
$FOO -> getenv(FOO) expansion.
I have this test :
if $HOME -eq /home/skx "alias home echo 'home is $HOME'"
When executed that gives me:
"home is /home/skx"
Steve
--
http://www.steve.org.uk/