[oclug] Text processing

Michael P. Soulier michael.soulier at rogers.com
Sat Mar 9 09:52:17 EST 2002


    echo "gateway: 192.168.0.1" | awk '{print $2}'
    192.168.0.1

    Mike

On 09/03/02 Dave Lewis did speaketh:

> If I said I had a chunk of text for instance
> 
> gateway: 192.168.0.1
> 
> how would you go about trimming it down to just
> 
> 192.168.0.1
> 
> I've plugged away at awk and I'm getting absolutely nowhere
> 
> 
> ALSO, in unix is there anyway to incude a colon in a variable ?  when I 
> assign a variable to the string above
> it seems to get lost at the :
> 
> ???
> 
> Any help would be appreciated.
> 
> Dave
> 
> _______________________________________________
> oclug mailing list
> oclug at lists.oclug.on.ca
> http://www.oclug.on.ca/mailman/listinfo/oclug

-- 
Michael P. Soulier <msoulier at mcss.mcmaster.ca>, GnuPG pub key: 5BC8BE08
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to Unix
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://tux.oclug.on.ca/pipermail/oclug/attachments/20020309/c0a4c45b/attachment.bin


More information about the OCLUG mailing list