The NR==FNR condition is true while fileb is being read. This is a common awk idiom for reading in a file of auxiliary data before the main processing. The host names in fileb will be used to populate the array h. Then in the main body of the script, if the first field is empty, the value of the host variable will be used for $1. Then the current value of $1 will be remembered in host in case the next line(s) have empty first fields. Then, if the array h does not contain the current host name (meaning it was not present in fileb), the current line is skipped. Finally, if the second field is identical to the variable acct, the line is printed.
(Really old variants of awk do not support passing in variables with the -v option -- if you have this problem, see if you can find nawk or mawk or gawk on your system, or an XPG4 awk. Or you can interpolate the variable directly into the script.)
That's exactly what I wanted. My version of awk didn't support the passing of the variable but I do have nawk and it worked perfectly.
Based on awk documentation I was trying to use the begin block to read the file but couldn't figure out how to read from two files. Would you mind explaining how awk determines which file to read from? Is it the code in the first set of braces {} reads the first file supplied and the second set the second file?
Hi there, I have a text file with several colums separated by "|;#" I need to search the file extracting all columns starting with the value of "1" or "2" saving in a separate file just the first 7 columns of each row maching the criteria, with replacement of the saparators in the nearly created... (4 Replies)
Hello ,
I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file.
Can someone tell me how i could go... (2 Replies)
Hi all,
I am new to AWK and I am trying to solve a problem that is probably easy for an expert. Suppose I have the following data file input.txt:
20 35 43
20 23 54
20 62 21
20.5 43 12
20.5 33 11
20.5 89 87
21 33 20
21 22 21
21 56 87
I want to select from all lines having the... (4 Replies)
Hi all , I have two files : dblp.xml with dblp records and itu1.txt with faculty members records. I need to find out how many dblp records are related to the faculty members. More specific: I need to find out which names from itu1.txt are a match in dblp. xml file , print them and show how many... (4 Replies)
Hello,
I want to get the maximum value of each record separated by empty line based on the 3rd column of each row within each record?
Input:
A1 chr5D 634 7 82 707
A2 chr5D 637 6 82 713
A3 chr5D 637 5 82 713
A4 chr5D 626 1 82 704... (4 Replies)
ok. so i have a list of country names which have been abbreviated. we'll call this list A
i have another list that which contains the what country each abbreviated name means. we'll call this list B.
so example of the content of list B:
#delimited by tabs
#ABBR COUNTRY COUNTRY... (2 Replies)
In the awk below I am trying to add a penalty to a score to each matching $1 in file2 based on the sum of $3+$4 (variable TL) from file1. Then the $4 value in file1 is divided by TL and multiplied by 100 (this valvue is variable S). Finally, $2 in file2 - S gives the updated $2 result in file2.... (2 Replies)
In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT DEBIAN
qmail-popup
qmail-popup(8) System Manager's Manual qmail-popup(8)NAME
qmail-popup - read a POP username and password
SYNOPSIS
qmail-popup hostname subprogram
DESCRIPTION
qmail-popup reads a POP username and password from the network. It then runs subprogram.
qmail-popup is most commonly invoked from inetd as
qmail-popup CHANGEME checkpassword qmail-pop3d Maildir
with CHANGEME replaced by the fully qualified domain name of the local host.
qmail-popup expects descriptor 0 to read from the network and descriptor 1 to write to the network. It reads a username and password from
descriptor 0 in POP's USER-PASS style or APOP style. It invokes subprogram, with the same descriptors 0 and 1; descriptor 2 writing to the
network; and descriptor 3 reading the username, a 0 byte, the password, another 0 byte, an APOP timestamp derived from hostname, and a
final 0 byte. qmail-popup then waits for subprogram to finish. It prints an error message if subprogram crashes or exits nonzero.
qmail-popup should be used only within a secure network. Otherwise an eavesdropper can steal passwords. Even if you use APOP, an active
attacker can still take over the connection and wreak havoc.
qmail-popup has a 20-minute idle timeout.
qmail-popup is based on a program contributed by Russ Nelson.
SEE ALSO maildir(5), qmail-local(8), qmail-pop3d(8)qmail-popup(8)