11-22-2007
need a quick basic shell script help
im trying to run the below if command
ifconfig -a |grep 10.100.120.21
gives me below output
inet addr:10.100.120.21 Bcast:10.100.120.255 Mask:255.255.255.0
i just want a basic shell which says if above exists then continue
how would i do this?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I gotta make a script to find files, not quite sure whats wrong...
filename is search
i run it
search ass* $HOME
ass* is the filename
and in my script i have...
find $2 -name $1 -print
but it never works, anyone know what i gotta fix?
and does anyone know the difference... (6 Replies)
Discussion started by: Freakytah
6 Replies
2. Shell Programming and Scripting
Hiii,
i have a doubt here--
I have to take backup of all the files inside directory dir(logs,tmp,corefiles) at the location $BackupLocation.i should take the backup of logs,tmp,corefiles inside the $BackupLocation directory and then remove the files and touch the files inside the directory... (1 Reply)
Discussion started by: namishtiwari
1 Replies
3. Shell Programming and Scripting
Cool. I played with scripts at home over the weekend. Come to find out not working on other shells. I have linux/bash at home, but now I'm trying on Solaris csh.
How would I write the following script for Solaris C shell?
----------
#!/bin/bash
NBR=231
for ((i = 0; i < $NBR; i++ ))
do... (1 Reply)
Discussion started by: ajp7701
1 Replies
4. Shell Programming and Scripting
Hello,
I have the following line in one of my shell scripts. It works fine when the search string($SERACH_STR) exists in the logfile($ALERTLOG) but if the search string does not exist this line errors out at run time. Is there a way to make this line return 0 if it is not able to find the... (4 Replies)
Discussion started by: luft
4 Replies
5. Shell Programming and Scripting
Lets say I wanted to create a script that would show what people are doing on my machine using the w command and refresh in about 6 seconds. What would be the easiest way to do this? I pretty much want the script to loop until I stop it.
I'm using the BASH shell by the way.
Help is appreciated.... (1 Reply)
Discussion started by: c4391
1 Replies
6. Shell Programming and Scripting
Need to subtract date stored in variable from the current date, answer should come in days..and months.
Suppose two variable having value like
A=”Wed Jan 15 08:59:08 GMT 2014”
B= `date` #Sun May 23 09:29:40 GMT 2010
SubtractAB= $A-$B #..?
AddAB=$A+$B #... ?
C=$B+9 # Sun May 23... (3 Replies)
Discussion started by: KuldeepSinghTCS
3 Replies
7. Shell Programming and Scripting
Hello,
I have a quick reference question:
I have a very long, but fairly straigtforward script written in c-shell. I was wondering if it is possible to call this script from bash (for ex. having a function in bash script which calls the c-shell script when necessary), and if so, are there any... (1 Reply)
Discussion started by: lapiduslost
1 Replies
8. Shell Programming and Scripting
Im trying to make a script that simply adds a word to the last available line in a txt file without overwriting any previous lines.
Ive googled this and there are great examples but no one explain what each function does, and i dont entirely understand how it works.
Basically Im looking for... (7 Replies)
Discussion started by: kylecn
7 Replies
9. Shell Programming and Scripting
##### (2 Replies)
Discussion started by: AidoPotato
2 Replies
10. Shell Programming and Scripting
I need to have a script read a file that has a list of words in a single column like below:Black
Blue
Brown
Orange
Red
Yellow
Green
White
Purple
Silver
Grey
Tan
Then print to another file just all of the two-word possible combinations. Example:
Black,Blue
Anyone want to take a... (4 Replies)
Discussion started by: vespasian
4 Replies
LEARN ABOUT SUSE
netmasks
netmasks(4) File Formats netmasks(4)
NAME
netmasks - network mask database
SYNOPSIS
/etc/inet/netmasks
/etc/netmasks
DESCRIPTION
The netmasks file contains network masks used to implement IP subnetting. It supports both standard subnetting as specified in RFC-950 and
variable length subnetting as specified in RFC-1519. When using standard subnetting there should be a single line for each network that is
subnetted in this file with the network number, any number of SPACE or TAB characters, and the network mask to use on that network. Network
numbers and masks may be specified in the conventional IP `.' (dot) notation (like IP host addresses, but with zeroes for the host part).
For example,
128.32.0.0 255.255.255.0
can be used to specify that the Class B network 128.32.0.0 should have eight bits of subnet field and eight bits of host field, in addition
to the standard sixteen bits in the network field.
When using variable length subnetting, the format is identical. However, there should be a line for each subnet with the first field being
the subnet and the second field being the netmask that applies to that subnet. The users of the database, such as ifconfig(1M), perform a
lookup to find the longest possible matching mask. It is possible to combine the RFC-950 and RFC-1519 form of subnet masks in the net-
masks file. For example,
128.32.0.0 255.255.255.0
128.32.27.0 255.255.255.240
128.32.27.16 255.255.255.240
128.32.27.32 255.255.255.240
128.32.27.48 255.255.255.240
128.32.27.64 255.255.255.240
128.32.27.80 255.255.255.240
128.32.27.96 255.255.255.240
128.32.27.112 255.255.255.240
128.32.27.128 255.255.255.240
128.32.27.144 255.255.255.240
128.32.27.160 255.255.255.240
128.32.27.176 255.255.255.240
128.32.27.192 255.255.255.240
128.32.27.208 255.255.255.240
128.32.27.224 255.255.255.240
128.32.27.240 255.255.255.240
128.32.64.0 255.255.255.192
can be used to specify different netmasks in different parts of the 128.32.0.0 Class B network number. Addresses 128.32.27.0 through
128.32.27.255 have a subnet mask with 28 bits in the combined network and subnet fields (often referred to as the subnet field) and 4 bits
in the host field. Furthermore, addresses 128.32.64.0 through 128.32.64.63 have a 26 bits in the subnet field. Finally, all other
addresses in the range 128.32.0.0 through 128.32.255.255 have a 24 bit subnet field.
Invalid entries are ignored.
SEE ALSO
ifconfig(1M), inet(7P)
Postel, Jon, and Mogul, Jeff, Internet Standard Subnetting Procedure, RFC 950, Network Information Center, SRI International, Menlo Park,
Calif., August 1985.
V. Fuller, T. Li, J. Yu, K. Varadhan, Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy, RFC 1519,
Network Information Center, SRI International, Menlo Park, Calif., September 1993.
T. Pummill, B. Manning, Variable Length Subnet Table For IPv4, RFC 1878, Network Information Center, SRI International, Menlo Park, Calif.,
December 1995.
NOTES
/etc/inet/netmasks is the official SVr4 name of the netmasks file. The symbolic link /etc/netmasks exists for BSD compatibility.
SunOS 5.10 7 Jan 1997 netmasks(4)