TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:7607] sed help



Pete Walters said:
> Here's a horribly quick hack:
> 
>  echo "(sf-hiper1a-099.dialup.slip.net [216.185.29.99])" | \
> sed -e s/"[A-Za-z0-9.( -]*\["//g -e s/"\][\)]*"//g
> 
> I didn't say it was pretty! 

My solution for getting the numeric address is a bit simpler...

sed -e "s/.*\[\(.*\)\].*/\1/