Shell script to give broadcast and network address

Hello,

I am running a post script in autoyast where I am trying to set the broadcast and network address.

I have the ip address and netmask already (reading from a file)..

I saw the post from fpmurphy but it is using ksh which isn't an option in autoyast.

Thanks in advance!

Isn't the ip address the network address?

Last I checked, the broadcast address = ~netmask | ip (top address), although sometime I think netmask & ip would also work (bottom address), yup, it does.

Can you call executables, or run somethng earlier to make it easy to pick up, like from the environment?

I run my suse install and at the end I ask for the following -

Ip address
Subnet Mask
Hostname

I put them in different files (ie /tmp/ip /tmp/netm etc).

I want to reference that to pull the Network addr and Broadcast addr -

Example -

/tmp/ip
10.20.18.10
/tmp/netm
255.255.240.0

Give me -

Network Address: 10.20.16.0
Broadcast Address: 10.20.31.255

My script writes more that that but the only portion that fails is the part that determines and writes the network address and broadcast address..

Run something like his script earlier or one time, and have it leave the results for each somewhere accessible to your script?