01-21-2013
Yes, you are right. \/.* removes everything after / for server & client IP addresses.
/ is a meta-character, hence it should be escaped.
This User Gave Thanks to Yoda For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
I have been working on awk and arrays. I have this small script:
cat maillog*|awk -F: '$2=="SMTP-Accept" && $5~/string/ {lastdate=substr($1,1,8); internaluser=$5; v++} END {for (j in v) {print lastdate, v, j}'| sort>> mail.list
This gives me the number of mails users are getting. ... (1 Reply)
Discussion started by: nitin
1 Replies
2. Shell Programming and Scripting
Been struggling with a problem, I have been trying to do this in awk, but am unable to figure this out, I think arrays have to be used, but unsure how to accomplish this.
I have a input file that looks like this:
141;ny;y;g
789;ct;e;e
23;ny;n;u
45;nj;e;u
216;ny;y;u
7;ny;e;e
1456;ny;e;g... (3 Replies)
Discussion started by: craigsky
3 Replies
3. Shell Programming and Scripting
Guys,
OK so i have been trying figure this all all day, i guess its a pretty easy way to do it.
Right, so i have to column of data which i have gotten from one huge piece of data. What i would like to do is to put both of these into one array using awk. Is this possible??
If so could... (1 Reply)
Discussion started by: imonthejazz
1 Replies
4. Shell Programming and Scripting
now its owkring - thanks fo rthe help all . (7 Replies)
Discussion started by: fusionX
7 Replies
5. Shell Programming and Scripting
Hi, I've written the following code to manipulate the first 40 lines of a data file into my desired order:
#!/bin/awk -f
{ if (NR<=(4)){
a=a$0" "}
else { if ((NR >= (5)) && (NR <= (13))) {
b=b$0" " }
else {if ((NR >= (14)) && (NR <= (25))){
c=c$0" "}
... (5 Replies)
Discussion started by: catwoman
5 Replies
6. Shell Programming and Scripting
Hi,
I have spent the afternoon trawling Google, Unix.com and Unix in a Nutshell for information on how awk arrays work, and I'm not really getting too far.
I ahve a batch of code that I am pretty sure can be better managed using awk, but I'm not sure how to use awk arrays to do what I'm... (1 Reply)
Discussion started by: littleIdiot
1 Replies
7. Shell Programming and Scripting
Hi,
I have the following data in a file for example:
Name="Fred","Bob","Peterson","Susan","Weseley"
Age="24","30","28","23","45"
Study="English","Engineering","Physics","Maths","Psychology"
Code="0","0","1","1","0"
Name="Fred2","Bob2","Peterson2","Susan2","Weseley2"... (14 Replies)
Discussion started by: james2009
14 Replies
8. UNIX for Dummies Questions & Answers
Hi
Can someone please explain the logic of awk arrays. I have been doing some reading but I dont understand this:
#!/usr/bin/gawk -f
{
arr++;
}
end
{
for(i in arr)
{
print arr,i
}
}
As I understand arr refs the arrays index, so while $2 is a string that cant... (2 Replies)
Discussion started by: chronics
2 Replies
9. Shell Programming and Scripting
Hi, buddies
I am new to shell scripting and trying to solve a problem. I read about arrays in awk that they are quite powerful and are associative in nature.
Awk Gurus Please help!
I have a file:
Id1 pp1 0t4 pp8 xy2
Id43 009y black
Id6 red xy2
Id12 new pp1 black
I have... (5 Replies)
Discussion started by: geli21
5 Replies
10. Shell Programming and Scripting
I'm a little stuck and would be grateful of some advice!
I have three files, two of which contain reference data that I want to add to a line of output in the third file. I can't seem to get awk to print array contents as I would expect.
The input files are:
# Input file
AAA,OAA,0313... (2 Replies)
Discussion started by: maccas17
2 Replies
LEARN ABOUT MOJAVE
netrestrict
NETRESTRICT(5) AFS File Reference NETRESTRICT(5)
NAME
NetRestrict - Defines interfaces not to register with AFS servers
DESCRIPTION
There are two NetRestrict files, one for an AFS client and one for an AFS File Server or database server. The AFS client NetRestrict file
specifies the IP addresses that the client should not register with the File Servers it connects to. The server NetRestrict file specifies
what interfaces should not be registered with AFS Database Servers or used to talk to other database servers.
Client NetRestrict
The NetRestrict file, if present in a client machine's /etc/openafs directory, defines the IP addresses of the interfaces that the local
Cache Manager does not register with a File Server when first establishing a connection to it. For an explanation of how the File Server
uses the registered interfaces, see NetInfo(5).
As it initializes, the Cache Manager constructs a list of interfaces to register, from the /etc/openafs/NetInfo file if it exists, or from
the list of interfaces configured with the operating system otherwise. The Cache Manager then removes from the list any addresses that
appear in the NetRestrict file, if it exists. The Cache Manager records the resulting list in kernel memory.
The NetRestrict file is in ASCII format. One IP address appears on each line, in dotted decimal format. The order of the addresses is not
significant. The value 255 is a wildcard that represents all possible addresses in that field. For example, the value 192.12.105.255
indicates that the Cache Manager does not register any of the addresses in the 192.12.105 subnet.
To display the addresses the Cache Manager is currently registering with File Servers, use the fs getclientaddrs command.
Server NetRestrict
The NetRestrict file, if present in the /var/lib/openafs/local directory, defines the following:
o On a file server machine, the local interfaces that the File Server (fileserver process) does not register in the Volume Location
Database (VLDB) at initialization time.
o On a database server machine, the local interfaces that the Ubik synchronization library does not use when communicating with the
database server processes running on other database server machines.
As it initializes, the File Server constructs a list of interfaces to register, from the /var/lib/openafs/local/NetInfo file if it exists,
or from the list of interfaces configured with the operating system otherwise. The File Server then removes from the list any addresses
that appear in the NetRestrict file, if it exists. The File Server records the resulting list in the /var/lib/openafs/local/sysid file and
registers the interfaces in the VLDB. The database server processes use a similar procedure when initializing, to determine which
interfaces to use for communication with the peer processes on other database machines in the cell.
The NetRestrict file is in ASCII format. One IP address appears on each line, in dotted decimal format. The order of the addresses is not
significant.
To display the File Server interface addresses registered in the VLDB, use the vos listaddrs command.
SEE ALSO
NetInfo(5), sysid(5), vldb.DB0(5), fileserver(8), fs_getclientaddrs(1) vos_listaddrs(1)
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 NETRESTRICT(5)