Matthew Gregan wrote:

Good catch.  Something like the following should handle that.

$ BLAH=${SSH_CLIENT%% *}
$ echo ${BLAH##*:}

Of course, that doesn't work if you're actually *using* IPv6:

$ echo $SSH_CLIENT
2002:ca00:3d60::1 33010 22

It's probably better to match explicitly, just in case:

$ BLAH=${SSH_CLIENT%% *}
$ echo ${BLAH#::ffff:}

--
"A story, I decided, is anything that keeps     http://carey.geek.nz/
the people reading turning the pages, and
doesn't leave them feeling cheated at the
end.  Everything else was up for grabs." -- Neil Gaiman

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to