LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] bloody redhat network init scripts (and regex's)

[ILUG] bloody redhat network init scripts (and regex's)

Kevin O Riordan koriordan at compsoc.com
Mon Jul 9 20:21:19 IST 2001


On Setting Orange, the 44th day of Confusion, Paul Jakma croaked:
> grrrr.....
[snip]
> ls ifcfg* | egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' |  egrep -v
> '(~|\.bak)$' | egrep -v 'ifcfg-ippp[0-9]+$' |  egrep
> 'ifcfg-[a-z0-9]+$' | sed 's/^ifcfg-//g'
> 
> (with /etc/sysconfig/network-scripts as PWD).
> 
> so how can i modify the sed so that it spits out any eth? interfaces
> before any remaining interfaces? (or any other suggestion as to how to
> quickly get this to spit out eth? before other interfaces).

Had a look at our (old) RH networking scripts ...

A quick job:

eth_interfaces=`ls ifcfg* | \
  egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
  egrep -v '(~|\.bak)$' | egrep -v 'ifcfg-ippp[0-9]+$' | \
  egrep 'ifcfg-[a-z0-9]+$' | sed 's/^ifcfg-//g' | egrep '^eth0'`
                                                ^^^^^^^^^^^^^^^^
non_eth_interfaces=`ls ifcfg* | \
  egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
  egrep -v '(~|\.bak)$' | egrep -v 'ifcfg-ippp[0-9]+$' | \
  egrep 'ifcfg-[a-z0-9]+$' | sed 's/^ifcfg-//g' | egrep -v '^eth0'`
                                                ^^^^^^^^^^^^^^^^^^

interfaces="$eth_interfaces $non_eth_interfaces"


HTH
-kev
-- 
	"The majority of the stupid is invincible and guaranteed
	 for all time.  The terror of their tyranny, however, is
	 alleviated by their lack of consistency."
               - Albert Einstein




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell