On Wed, 3 Oct 2001, John Hamill wrote: > G'day > > I am using 2.2.19 Eigerstein beta. I have a bit of a question about expr. > > > I have the following line in a script to work out what the network address > is. > > network=`expr $ptpaddr : '\([0-9]*\.[0-9]*\.[0-9]*\.\)'`0 > > This works ok under red hat linux, but lrp gives > > # bash test > exp: arith: syntax error: "192.168.9.234 : \([0-9]*\.[0-9]*\.[0-9]*\.\)" > > Does anyone have a workaround for this. I am trying to automate the process > of setting up the VPN links with CIPE rather than hard coding the ip address > directly.
network=`echo $ptpaddr | sed 's/\([0-9]*\.[0-9]*\.[0-9]\)\.[0-9]/\1.0/'` However, I am not happy with this solution because netmasks do not have to be on byte boundaries. A more general solution would be to use David Douthitt's "ipmask" program (http://leaf.sourceforge.net/pub/oxygen/packages/ipmask.lrp). You could add it to your package and risk wasting space if it is already there, or require that the ipmask.lrp be installed for your package to work. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<[EMAIL PROTECTED]> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...2k --------------------------------------------------------------------------- _______________________________________________ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user
