Re: Bash scripting help...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El Lunes, 7 de Agosto de 2006 17:26, Marko Vojinovic escribió:
[...]
> but the problem is that I just need to set the variable, say macaddr, to
> the above value, hopefully lowercase, without the [ and ]. Next obvious
> thing was:
>
> # arping -f -I eth0 $ipnumber | grep Unicast
> Unicast reply from 10.0.0.3 [00:0C:29:C8:DE:E2]  1.040ms

Try this:

macaddr=$(arping -f -I eth0 $ipnumber | grep Unicast | cut -d "[" -f1 | 
cut -d "]" -f2)

-- 
Mauricio Vergara Ereche                 User #188365 counter.li.org


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux