i have an awk statement which i am using to count the number of occurences of the number ,5, in the file:
awk '/,5,/ {count++}' TRY.txt | awk 'END { printf(" Total parts: %d",count)}'
i know there is a total of 10 matches..what is wrong here?
thanks (16 Replies)
Hi All,
I would like my code to be able to print out the whole line if 1st field has a dot in the number. Sample input and expected output given below.
My AWK code is below but it can;t work, can any expert help me ?
Thanks in advance.
{if ($1 ~ /*\.*/) { print $0 }}
Input:
... (2 Replies)
Howdy.
I know this is most likely possible using sed or awk or grep, most likely a combination of them together, but how would one go about running a grep like command on a file where you only try to match your pattern to the second field in a line, space delimited?
Example:
You are... (3 Replies)
Hi,
I have requirement that I need to split my input file into two files based on a search pattern "abc"
For eg. my input file has below content
abc
defgh
zyx
I need file 1 with
abc
and file2 with
defgh
zyx
I can use grep command to acheive this. But with grep I need... (8 Replies)
Hi,
I am trying with the below Perl command to print the first field when the second field matches the given pattern:
perl -lane 'open F, "< myfile"; for $i (<F>) {chomp $i; if ($F =~ /patt$/) {my $f = (split(" ", $i)); print "$f";}} close F' dummy_file
I know I can achieve the same with the... (7 Replies)
Hi
Am trying to sum up a file
# cat /Out
maths 2 0.0
english 2091 0.2
history -1 0.0
physics 18 0.0
--------------------------------------
maths ... (9 Replies)
To match range, the command is:
awk '/BEGIN/,/END/'
but what I want is the range is printed only if there is additional pattern that matches in the range itself? maybe like this:
awk '/BEGIN/,/END/ if only in that range there is /pattern/'
Thanks (8 Replies)
Using the attached file, the below awk command results in the output below:
I can not seem to produce the desired results and need some expert help. Thank you :).
awk -F'' '
{
id += $4
value += $5
occur++
}
END{
printf "%-8s%8s%8s%8s\n", "Gene", "Targets", "Average Depth", "Average... (3 Replies)
I am trying to remove lines in the target.txt file if $5 before the - in that file matches sorted_list. I have tried grep and awk. Thank you :).
grep
grep -v -F -f targets.bed sort_list
grep -vFf sort_list targets
awk
awk -F, '
> FILENAME == ARGV {to_remove=1; next}
> ! ($5 in... (2 Replies)
Trying to output a result that uses the data from file to combine and subtract specific lines. If $4 matches in each line then the last $6 value is added to $2 and that becomes the new$3. Each matching line in combined into one with $1 then the original $2 then the new$3 then $5. For the cases... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT DEBIAN
node.perms
NODE.PERMS(5) Linux Programmer's Manual NODE.PERMS(5)NAME
node.perms - LinuxNode permissions file.
DESCRIPTION
Node.perms file is read at program startup with the knowledge of users username (call), connection type (AX.25, NET/ROM, ROSE, TCP/IP),
peers IP address (for TCP/IP) and port name (for AX.25). The first entry matching this information is taken and user is asked for password
and given permissions according to it.
The lines within node.perms must either be a comment line, which starts with a # in the first column, or a permission entry in the follow-
ing format, each field being delimited by white space:
username type portname password permissions
The field descriptions are:
username This is matched against users username (call) without SSID. An asterisk (*) matches any username.
type This is matched against the type of the connection to user. Possible values for this field are:
* matches any type of connection.
ax25 matches users coming in with AX.25.
netrom matches users coming in with NET/ROM.
rose matches users coming in with ROSE.
local matches TCP/IP connections where users host is in "local" network as defined in node.conf(5).
ampr matches TCP/IP connections where users host is in amprnet (44.0.0.0/8).
inet matches TCP/IP connections where users host is neither in "local" network nor in amprnet.
host matches users starting LinuxNode from shell.
portname If user is coming in with AX.25 this field is matched against the local port name the user is coming in via. An asterisk (*)
matches any port name.
password If the previous tree fields match and this field is not a single asterisk (*) the user is asked for a password. The password
is then matched against this field.
permissions This field represents a a bitmask of operations the user is permitted to do. It is a sum of the values listed here:
1 permits logging in even if no other permissions are given.
2 permits outgoing AX.25 connects.
4 permits outgoing NET/ROM connects.
8 permits telneting to hosts in the "local" network as defined in node.conf(5).
16 permits telneting to hosts in amprnet.
32 permits telneting to hosts neither in the "local" network nor in amprnet.
64 permits using hidden ports in outgoing AX.25 connections. (See HiddenPorts command in node.conf(5).)
128 permits outgoing ROSE connects.
256 The no-escape flag. Disables the escape mechanism for this user.
FILES
/etc/ax25/node.perms
SEE ALSO node(8), node.conf(5), axports(5), ax25(4).
Linux 16 June 1999 NODE.PERMS(5)