Shell script to give broadcast and network address


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script to give broadcast and network address
# 1  
Old 10-18-2010
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!
# 2  
Old 10-18-2010
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?
# 3  
Old 10-18-2010
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..
# 4  
Old 10-18-2010
Run something like his script earlier or one time, and have it leave the results for each somewhere accessible to your script?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX Script to query Active Directory: give cn (NT login name) and receive mail (Email address)

Hi folks I need to write UNIX script (with ldapsearch) to query Active Directory. Input is NT login name and output is Email address. Attached a screenshot of Sysinternals "AD Explorer". I need to do the same in CLI. http://i.imgur.com/4s6FB.png I am absolute LDAP/ldapsearch noob. (0 Replies)
Discussion started by: slashdotweenie
0 Replies

2. Programming

How to broadcast a message across the network using Socket programming in C??

My problem definition is ,I have to send a message from one node in a network and it has to be broadcasted to all other nodes in the network.The program what I have given below will be running in all the nodes in the network.The same program should be capable of sending(broadcasting) and receiving.... (1 Reply)
Discussion started by: vigneshinbox
1 Replies

3. Solaris

ifconfig - making netmask & broadcast address permanent?

hi, I am trying to configure one of my interfaces, but after reboot - i lose the changes to the netmask & broadcast address. I have added an entry in /etc/netmasks, but it doesnt pick up the new settings. any ideas - much appreciated. before reboot: eri0:... (3 Replies)
Discussion started by: badoshi
3 Replies

4. Shell Programming and Scripting

network and broadcast address

Hi Suppose You have two computers. One named kenny which has an IP address of 192.168.0.7. kenny lives on a subnet with a subnet mask of 255.255.255.240. The second computer is called zathras, which has an IP address of 192.168.0.17, zathras lives on a network with the same subnet mask. i)... (4 Replies)
Discussion started by: scofiled83
4 Replies

5. Shell Programming and Scripting

Can give the input to prompt using shell script

Hi, I want to send input to promt from shell script, this thing is possible. I give the one command `/usr/share/ssl/misc/CA -newreq` it needs some user input like password etc., but i need this input also from shell script but it does not works. `/usr/share/ssl/misc/CA -newreq` <<EOF... (2 Replies)
Discussion started by: Vaibhav Agarwal
2 Replies

6. Shell Programming and Scripting

how to give a variable to a command in shell script...

hi all... I am executing a comman in a shell script but the command needs a user input of character 'y' as input so it stops in between...may i know is there is any way of giving that character as input in the shell script itself???...thanks in advance.... (6 Replies)
Discussion started by: santy
6 Replies

7. Solaris

bge card and broadcast address

I have a bge1 card and a bge0 card, i want the broadcast addresses to match, ifconfig shows this lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 ... (1 Reply)
Discussion started by: csaunders
1 Replies

8. UNIX for Dummies Questions & Answers

network address and broadcast address?

say I have a IP address which is 10.0.0.12, and subnet mask is 255.255.255.240, what is the network address and what is the broadcast address which host lives on? And could you explain how to get the answer? thanx in advance! (7 Replies)
Discussion started by: pnxi
7 Replies

9. Shell Programming and Scripting

shell script queries: $home; broadcast ping

Dear all, This is the Bionic Fysh again. I have two quick questions: 1- when writing shell scripts, how does one allow the tilda ~ into the script ? e.g ls ~; ls ~me; user=you; ls ~$user (N.B I think that for this one you need: ls `~$user`) 2- In FreeBSD 4.0, I would like for a... (6 Replies)
Discussion started by: bionicfysh
6 Replies

10. IP Networking

broadcast address

What is the significance of the broadcast address? (1 Reply)
Discussion started by: 98_1LE
1 Replies
Login or Register to Ask a Question