In perl I want to do remove the top line of my input file then process the next line. I want to do something like
head -1 inputfile > temp
grep -v temp inputfile > newinputfile
cp newinputfile inputfle
is this possible in perl? (3 Replies)
Ok. I'm just starting to use AWK and I have a question. Here's what I'm trying to do:
uname -n returns the following on my box:
ftsdt-svsi20.si.sandbox.com
I want to pipe this to an AWK statement and make it only print:
svsi20
I tried:
uname -n | awk '{ FS = "." ; print $1 }'
... (5 Replies)
I am working with bash on HP-UX server at school.
As practice for scripting, I am trying to make a pretend server admin script that adds a user to the system, deletes a user from the system, and lists all users of the pretend system. I have accomplished this with a select loop. Adding users, and... (2 Replies)
I have a script with this statement:
/usr/xpg4/bin/awk -F"" 'NR==FNR{s=$2;next}{printf "%s\"%s\"\n", $0, s}' LOOKUP.TXT finallistnew.txt >test.txt
I want to include logic or an additional step that says if there is no data in field 3, move the whole line out of test.txt into an additional... (9 Replies)
hello
I have a file with lines of info separated with "|"
I want to amend the second field of the last line, using AWK
my problem is with geting awk to return the last line
this is what I am using
awk 'END{ print $0 }' myFile
but I get an empty result
I tried the... (13 Replies)
Hi fellow linux-ers,
I have a quick question for you. I have the following text, which I would like to modify:
10 121E(121) 16 Jan
34S 132E 24 Feb
42 176E(176) 18 Sep
21S 164E 25 May
15 171W(-171) 09 Jul
How can I do the following 2 modifications using sed and/or awk?
1. in 1st column,... (1 Reply)
gawk 'BEGIN{count=0} /^Jan 5 04:33/,0 && /fail/ && /09x83377/ { count++ } END { print count }' /var/log/syslog
what is wrong with this code? i want to search the strings "fail" and "09x83377" from all entries. im grabbing all entries in the log starting from Jan 5 04:33 to the end of the... (3 Replies)
Hi all,
I've got a file that has 12 fields. I've merged 2 files and there will be some duplicates in the following:
FILE:
1. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, 100
2. ABC, 12345, TEST1, BILLING, GV, 20/10/2012, C, 8, 100, AA, TT, (EMPTY)
3. CDC, 54321, TEST3,... (4 Replies)
I am trying to use awk to identify and print out records in fields that are empty along with which line they are in. I hope the awk below is close, it runs but nothing results. Thank you :).
awk
awk -F'\t' 'FNR==NR ~ /^*$/ { print "NR is empty" }' file
file
123 GOOD ID 45... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT SUSE
distrib.pats
DISTRIB.PATS(5) InterNetNews Documentation DISTRIB.PATS(5)NAME
distrib.pats - Default values for the Distribution: header
DESCRIPTION
The file pathetc/distrib.pats is used by nnrpd to determine the default value of the Distribution: header. Blank lines and lines beginning
with a number sign ("#") are ignored. All other lines consist of three fields separated by a colon:
<weight>:<pattern>:<value>
The first field is the weight to assign to this match. If a newsgroup matches multiple lines, the line with the highest weight is used.
This should be an arbitrary integer greater than zero. The order of lines in the file is only important if groups have equal weight (in
which case, the first matching line will be used).
The second field is either the name of a newsgroup or a uwildmat(3)-style pattern to specify a set of newsgroups.
The third field is the value that should be used for the Distribution: header of a posted article, if this line was picked as the best
match and no Distribution: header was supplied by the user. It can be an empty string, specifying that no Distribution: header should be
added. If it is not empty, it is better to only use US-ASCII characters for that field; otherwise, make sure it is encoded in UTF-8.
When a post is received by nnrpd that does not already contain a Distribution: header, each newsgroup to which an article is posted will be
checked against this file in turn, and the matching line with the highest weight will be used as the value of the Distribution: header. If
no lines match, or if the matching line has an empty string for its third field, no header will be added. In case a distribution is added
by nnrpd, make sure it is not rejected by the newsfeeds "ME" entry.
A list of recommended distributions can be specified and described in distributions(5).
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Converted to POD by Russ Allbery <rra@stanford.edu>.
$Id: distrib.pats.pod 8803 2009-11-15 09:29:41Z iulius $
SEE ALSO distributions(5), inn.conf(5), newsfeeds(5), nnrpd(8), uwildmat(3).
INN 2.5.2 2009-11-15 DISTRIB.PATS(5)