Messages in this thread |  | | From | (Miquel van Smoorenburg) | Subject | Re: Pre-release 2.0.5 breaks network config scripts | Date | Fri, 24 May 1996 19:42:08 +0200 (MET DST) |
| |
In article <4nqddo$ahm@flint.inr.ac.ru>, really kuznet@ms2.inr.ac.ru <inr-linux-kernel@ms2.inr.ac.ru> wrote: >Herbert Rosmanith (herp@wildsau.idv.uni-linz.ac.AT) wrote: >: > Can we at least put a patch into route to strip the host portion. This is >: > the way I use route. I want say: route the net for which this host >: > address is valid. In this way, a simple shell scripts can say: >: > >: > echo -n "Enter IP" >: > read ip >: > ifconfig eth0 $ip >: > route add -net $ip > >: how about this patch: > >: - route add -net $ip >: + route add -host $ip > >Incorrect. "route add -host $ip" will not add route to your >ethernet network.
Ah, a shell script programming contest thread ;) How about:
echo -n "Enter IP" read ip ifconfig eth0 $ip route add -net ${ip%.*}.0
The ${x% and ${x# stuff is very flexible..
Mike. -- + Miquel van Smoorenburg + Cistron Internet Services + Living is a | | miquels@cistron.nl (SP6) | Independent Dutch ISP | horizontal | + miquels@drinkel.ow.org + http://www.cistron.nl/ + fall +
|  |