Sponsored Content
Top Forums Shell Programming and Scripting Checking for a valid MAC Address Post 302521159 by hxman on Tuesday 10th of May 2011 11:31:30 AM
Old 05-10-2011
Quote:
Originally Posted by fpmurphy
Code:
#!/bin/ksh93

while :
do
   read MAC?"Enter MAC address: "
   case "$MAC" in
       ({2}([[:xdigit:]]){5}(:{2}([[:xdigit:]])))
       break;;
   esac
   echo "Invalid MAC address"
done


`(' unexpected..........

What is the purpose of the : after while?

Thanks
 

9 More Discussions You Might Find Interesting

1. IP Networking

How to Achive IP address through MAC(Ethernet) address

Hi sir, i want to make such programe which takes MAC(Ethernet) address of any host & give me its IP address....... but i'm nt getting that how i can pass the MAC address to Frame........ Please give me an idea for making such program... Thanks & regards Krishna (3 Replies)
Discussion started by: krishnacins
3 Replies

2. Shell Programming and Scripting

Checking the valid paths in the shell script

Hi i am using a shell script for renaming the files and placing in the remote location(FTP) my code is: cd $1 day=$(date +%d) for i in `ls -1 BBW*` do last=`tail -1 $i` pat=`expr "$last" : '.*(\(.*\)).*'` pat=`echo $pat | sed 's/ /_/'` pat=$pat$day mv $i $pat rm -f $day done... (3 Replies)
Discussion started by: srivsn
3 Replies

3. Shell Programming and Scripting

checking valid values in variable

I'm using the following in my script. if echo $cpuidle |/usr/bin/egrep ; then when I issue this statement it issues the value of the variable back to stdout which ends up in my output file. Is there a better way to write this? I'm using ksh on solaris 9. (3 Replies)
Discussion started by: MizzGail
3 Replies

4. Solaris

XDMCP fatal error: Session declined No valid address

Hi ppl, anyone has encounter this error before? I can't remote login to another machine residing in the same subnet via CDE and the error I get in var/dt/Xerrors is XDMCP fatal error: Session declined No valid address Warning: Name: submenu_options_button Class: XmRowColumn ... (2 Replies)
Discussion started by: xiaochensg
2 Replies

5. Solaris

Get ip address from mac address

I have following message in my messages file on solaris 10 WARNING: e1000g3712000:3 has duplicate address 010.022.196.011 (in use by 00:50:56:85:25:ef); disabled Now is there any way i can find which server has 00:50:56:85:25:ef mac address either IP or Hostname ? (6 Replies)
Discussion started by: fugitive
6 Replies

6. IP Networking

Tracing a MAC address to IP address: Solaris

Hi there I lost connectivity to one of our remote systems and when I checked the messages log I found the following: Aug 10 23:42:34 host xntpd: time reset (step) 1.681729 s Aug 16 13:20:51 host ip: WARNING: node "mac address" is using our IP address x.x.x.x on aggr1 Aug 16 13:20:51 host... (9 Replies)
Discussion started by: notreallyhere
9 Replies

7. Solaris

XDMCP fatal error: Session declined No valid address

Hello all, I just post here to expose an issue I have encountered two days ago and finally successfully solve just right now using info on this site( but not only). Config : Two SUN/ORACLE sparc Solaris 10 system. Purpose : do a remote CDE login from host one to the host two. method: from... (0 Replies)
Discussion started by: sunsunsun
0 Replies

8. Shell Programming and Scripting

Valid date checking in the file

File contian below data... 20111101 20111102 20111131 I am new to unix and per scirpt... First two records are valid and last record is invalid,how to get the valid records... Please help me unix or perl script. :wall: Thanks, Murali (5 Replies)
Discussion started by: muralikri
5 Replies

9. IP Networking

MAC Address - Four Interfaces with the same MAC Address

four interfaces with ifconfig all interfaces have the same mac. If is not set for unique. but it still works. what difference does it make to have all macs the same or different? (4 Replies)
Discussion started by: rrodgers
4 Replies
XVIF(4) 						 BSD/xen Kernel Interfaces Manual						   XVIF(4)

NAME
xvif -- Xen backend paravirtualized network interface SYNOPSIS
pseudo-device xvif DESCRIPTION
The xvif interface forms the backend part of the paravirtualized drivers used by Xen domains to offer network connectivity. When the guest domain is NetBSD, the endpoint of the xvif interface is a xennet(4) interface. In the XenStore, xvif and xennet are identi- fied by ``vif'' (virtual interface) entries. All xvif interfaces follow the ``xvifXiY'' naming convention, where 'X' represents the guest domain identifier, and 'Y' an arbitrary identi- fier; most of the time, it is the frontend interface identifier, e.g. ``xennetY''. For convenience, the MAC address of an xvif interface is chosen by incrementing the third byte of the MAC address of the frontend device. Conceptually, frontends and backends drivers are similar to two Ethernet cards connected via a crossover cable. DIAGNOSTICS
xvif%di%d: can't read %s/mac: %d The MAC address for this interface could not be read from XenStore. xvif%di%d: %s is not a valid mac address The MAC address specified in the configuration file of the newly created guest domain is invalid. xvif%di%d: Ethernet address %s MAC address of the xvif interface. SEE ALSO
ifmedia(4), xennet(4), ifconfig(8) HISTORY
The xvif driver first appeared in NetBSD 4.0. AUTHORS
The xvif driver was written by Manuel Bouyer <bouyer@NetBSD.org>. BSD
April 7, 2011 BSD
All times are GMT -4. The time now is 04:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy