tricky shell question?
- From: cconnell_1@xxxxxxxxx
- Date: Thu, 13 Dec 2007 11:30:17 -0800 (PST)
Hello
Im writing a script tp get some settings for a network interface, i
want to make it support a vlan interface
such as:
e1000g430002
which i get from ifconfig -a
I want to run some commands on the above e.g. awk/sed to return:
e1000g2 (the last digit is the physical interface number)
The characteristics of a vlan interface is that after the 'last'
letter in the interface is followed by 4 or more digits(we times it by
1000), then add the instance number on the end(this is the number im
after)
e.g.
bge435003 - real interface= bge3 (vlan 435)
ce435003 - real interface = ce3 (vlan 435)
I also need to grep the instance number which is characterized by the
digits after the last letter of the interface.
e.g.
e1000g10 = instance number = 10
Any help appreciated
Thanks
.
- Follow-Ups:
- Re: tricky shell question?
- From: Icarus Sparry
- Re: tricky shell question?
- Prev by Date: How to Write an Infinite Loop that doesn't Die when Program Dies
- Next by Date: can you concat strings in shell
- Previous by thread: How to Write an Infinite Loop that doesn't Die when Program Dies
- Next by thread: Re: tricky shell question?
- Index(es):
Relevant Pages
|