home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!lll-winken!fnnews.fnal.gov!fnsony.fnal.gov!shah
- From: shah@fnsony.fnal.gov (Hemant Shah)
- Newsgroups: comp.sys.sgi
- Subject: Re: FAQ How to obtain my ethernet address?
- Message-ID: <1du9g1INNj2o@fnnews.fnal.gov>
- Date: 12 Nov 92 18:58:09 GMT
- References: <34037@adm.brl.mil>
- Reply-To: shah@fnalb.fnal.gov
- Organization: Fermi National Accelerator Laboratory, Batavia, IL
- Lines: 51
- NNTP-Posting-Host: fnsony.fnal.gov
-
- In article <34037@adm.brl.mil>, HACK@fcrfv2.ncifcrf.gov writes:
- |> I know it's been recently asked but I can't find my notes . . .
- |>
- |> What is the command to obtain my Ethernet address?
- |>
- |> Thanks.
- |>
- |> Dallas C. Hack
- |> hack@fcrfv1.ncifcrf.gov
-
- Here's a little shell script I use:
- ---------------- 8< ------- Begin shell script ---------- 8< -------------
- #!/bin/sh
- # On SGI systems, sysinfo command gives 2 different outputs depending on
- # the model. It display 4 rows of numbers. On some systems it give last 4
- # bytes of the ethernet address and rest of the fields are "00", in that
- # case prepend "08:00" which identifies this system as SGI.
- # On other systems it displays 4 rows of numbers (not all are "00")
- # in this case first alternate 6 set of numbers give full ethernet address
- # of the system.
- ether_addr=`sysinfo | nawk 'BEGIN{getline}
- {
- for( i=5; i<=NF; i++)
- if( $i != "00")
- {
- temp_flag = 1
- i = NF
- }
- if( temp_flag > 0 )
- {
- printf("%s",$1)
- for( i=3; i <= 12; i=i+2)
- printf(":%s",$i)
- }
- else
- printf("08:00:%s:%s:%s:%s",$1,$2,$3,$4)
- exit}'`
-
- echo $ether_addr
-
- ---------------- 8< ------- end shell script ---------- 8< -------------
-
- --
- -------------------------------------------------------------------------------
- Hemant Shah | All the opinions expressed are my own
- Fermi National Accelerator Laboratory | and does not necessarily reflect
- Systems Integration Group | those of Fermilab.
- E-mail :shah@fnal.fnal.gov |
- Voice : (708) 840-8071 | I haven't lost my mind
- Fax : (708) 840-2783 | it's backed on tape somewhere.
- -------------------------------------------------------------------------------
-