Simplifying IPv6 addresses from user input


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Simplifying IPv6 addresses from user input
# 1  
Old 05-24-2011
Data Simplifying IPv6 addresses from user input

hi friends,
im new to scripting and am tiring out to valid an ip address if user inputs
Code:
9 : 003 : 0 : 0 : 100 : 256

,i need to suppress all leading zeros and single zero
ie out put for the same should be
Code:
9 : 3 :   :   : 100 : 256

can any help using awk ,regular expression to split the string
and validate...

Moderator's Comments:
Mod Comment Please use a descriptive subject for threads, not just "Help"

Last edited by pludi; 05-24-2011 at 08:42 AM.. Reason: Title, formatting
# 2  
Old 05-24-2011
Hi,

Parsing IPv6 is not an easy task, that's why several regular expression and methods exists.
You should read this, to decide what kind of solution you wanna use.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

How to assign IPv4 and IPv6 addresses with same interface?

Hello dears how to assign IPv4 and IPv6 addresses with same interface on solaris 10 (1 Reply)
Discussion started by: ttashman
1 Replies

2. UNIX for Dummies Questions & Answers

Assigning ipv6 to bonding interface - getting old as well as changed ipv6 in ifconfig output

Hi, I have created a bonding bond1 interface with 6 Eth , mode=4. Recently i have changed my old ipv6 to new one and tried to restart as well as reload network service. Post which i can see old as well as changed ipv6 in ifconfig command output. Below are few files and command output for your... (1 Reply)
Discussion started by: omkar.jadhav
1 Replies

3. Shell Programming and Scripting

User input and run awk using the input

I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :). The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies

4. UNIX for Dummies Questions & Answers

How can i know last 10 IP addresses of a user id in UNIX?

Hi, I am working on a project where i can commit the project filles using UNIX commands. Without my awareness some body has changed and commited the project files with my login credentials. Now I want to know the UNIX command to find out the last 10(or) more IP addresses that uses my project... (4 Replies)
Discussion started by: saikrishna_1245
4 Replies

5. Shell Programming and Scripting

Script interacts with user , based on user input it operates

i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled. #!/bin/sh echo " Enter your choice to continue y/Y OR n/N to quit " read A if then echo " user requested to continue " ##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies

6. Shell Programming and Scripting

How to get the user input recursively until the user provides valid input

Hi, echo "Enter file name of input file list along with absolute path : " read inputFileList if then for string in `cat inputFileList` do echo $string done else echo " file does not exist" fi From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies

7. UNIX for Advanced & Expert Users

Assigning multiple IPV6 addresses with ISC dhcpd

Hi, Apologies if this is the wrong forum or this question has been answered already. I'm using the ISC dhcpd server on Centos 6.0, and can happily assign a single IPV6 address to a client with entries like this: subnet6 fd01:0:0:5::/64 { option dhcp6.name-servers fd01:0:0:5::226;... (0 Replies)
Discussion started by: jusme
0 Replies

8. UNIX for Dummies Questions & Answers

searching for strings/user IP addresses

Hi, I'm trying to write a script, which will perform the following actions. Pick up the IP address of the PC I have used to telnet into the SUN server. Export this. Run the rest of my script. I am struggling with the first part, I know the IP address can be displayed by the command... (2 Replies)
Discussion started by: 30694
2 Replies
Login or Register to Ask a Question