[plug] strncmp in shell

James Devenish devenish at guild.uwa.edu.au
Mon Jan 19 14:52:52 WST 2004


In message <20040119064221.GA9992 at patrick.wattle.id.au>
on Mon, Jan 19, 2004 at 02:42:21PM +0800, Cameron Patrick wrote:
> % [[ "$FOO" == "wurble*" ]] && echo hi

Apologies, that was a typo in my e-mail message. I had meant
[[ "$FOO" == wurble* ]]

(The == syntax accepts a "pattern" as its right-hand argument,
not a "string".)

> $ FOO=one
> $ echo ${FOO/one/}
> 
> $ echo ${FOO/onex/}
> one
> $ echo ${FOO/on/}
> e
$ FOO=oneone
$ echo ${FOO/one/}
one




More information about the plug mailing list