Anthony E. Greene wrote:
----------------->>>>
On Fri, 28 Dec 2001, Patrick Nelson wrote:
>For some reason I just cant get this...
>
>me@mehost>setap -l | grep ESSID:   # lists the following
>lo        no wireless extensions.
>
>eth0      IEEE 802.11-DS  ESSID:"MECOOLAP01"  Nickname:"mehost"
>me@mehost>
>
>I'm trying to figure out how to pull the MECOOLAP01 from the line.  Any
>suggestions?

setap -l | grep ESSID: | cut -f 2 -d ':' | cut -f 1 -d ' ' | sed -e
"s/\"//g"

That is all one line.
----------------->>>>
Thanks Tony,

You got me looking at sed and I dropped all the grep and cut stuff with just
one sed command...

  essid=$(setap -l | sed -ne '/ESSID:/ { s/.*ESSID:"\([^"]*\)".*/\1/;p;})

What do you think?  I like this and the rday's expr method:

  essid=$(expr "$(setap -l | grep ESSID)" : ".*ESSID:\"\([^ ]*\)\"")

These both work great!



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to