For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > splitting IPs in shells

splitting IPs in shells

Created by dave. Last edited by dave, 16 years and 201 days ago. Viewed 2,861 times. #1
[edit] [rdf]
labels
attachments

Splitting an IP-like number into its components

...without using perl, or awk, or other nasties:

$ set `echo 10.20.30.40 | tr '.' ' '`
$ echo $1
10
$ echo $2
20
$ echo $3
30
$ echo $4
40
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt