In the OSX forum I am starting a new awk project to learn awk.
In this code snippet I have had to check boundaries to ensure that no NUMERICAL error occurs in the rest of the code...
What I don't understand however, is when I enter random characters I expect an error, but instead I get the RATE set to '4000' and it keeps working.
Can one of you awk experts explain what is happening and/or why?
hi there
i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format
but i get an error
please can anybody help me out in this problem ??????
i give my code here including error
awk `
# date-month -- convert mm/dd/yy to month day,... (2 Replies)
Hi all,
i have the files in the below sequence:
fancy_LANG_STD_AU_2008-03-05.dat
fancy_LANG_STD_HK_2008-03-06.dat
fancy_LANG_STD_NZ_2008-03-05.dat
fancy_STD_AU_2008-03-05.dat
fancy_STD_HK_2008-03-06.dat
fancy_STD_NZ_2008-03-05.dat
i am trying to sort them like below:
... (3 Replies)
This is my disk space on solaris box and i wrote a simple script which identifies mount points which crosses 90% or above.
But the AWK part is throwing some error and im unable to debug..
mzaheer @ UAT 144 % => df -k
Filesystem kbytes used avail capacity Mounted on... (5 Replies)
Hello all,
Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val:
> cat getnon0file.sh
#!/bin/bash
this="getnon0file.sh"
USAGE=$this"
InFile="xyz.38"
Min="0.05"
#
awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Hi
I am trying to create a file with count of lines and string from shell variable, i am getting the error incorrect syntax.
Below is the code :
wc -l $filename | awk '{ print $1"|"$2"|"${SOURCETYPE} }'>>$AUDITFILENAME
Could someone help me on this? (7 Replies)
i have been trying to run the following bash script, but get error:
awk: cmd. line:1: -
awk: cmd. line:1: ^ unexpected newline or end of string
I have been trying to figure out what the problem is but to no avail. I need to run the script urgently for a project, so any help will be highly... (5 Replies)
Good evening, Im newbie at unix specially with awk
From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example
1.
This is the inputfile:
$ more MapaRep.txt
ds_extra_nikira_usuarios... (18 Replies)
Hi friends...
(Apoloigies for any typos.)
(Don, thanks for your input.)
Consider these two code snippets:-
awkerror1.awk
#!/usr/bin/awk -f
BEGIN \
{
SAWTOOTHPLUS64 = " !#$&\'\)*,-/0235689:<>?ABDEGHJKMNPQSTVWYZ\\^_abdeghjkmnpqstvwyz|}~"
for(LOOP = 1; LOOP <= 13; ++LOOP)
{... (3 Replies)
Discussion started by: wisecracker
3 Replies
LEARN ABOUT MOJAVE
tc-police
Policing action in tc(8) Linux Policing action in tc(8)NAME
police - policing action
SYNOPSIS
tc ... action police rate RATE burst BYTES[/BYTES] [ mtu BYTES[/BYTES] ] [ peakrate RATE ] [ overhead BYTES ] [ linklayer TYPE ] [ CONTROL
]
tc ... filter ... [ estimator SAMPLE AVERAGE ] action police avrate RATE [ CONTROL ]
CONTROL := conform-exceed EXCEEDACT[/NOTEXCEEDACT
EXCEEDACT/NOTEXCEEDACT := { pipe | ok | reclassify | drop | continue | goto chain CHAIN_INDEX }
DESCRIPTION
The police action allows to limit bandwidth of traffic matched by the filter it is attached to. Basically there are two different algo-
rithms available to measure the packet rate: The first one uses an internal dual token bucket and is configured using the rate, burst, mtu,
peakrate, overhead and linklayer parameters. The second one uses an in-kernel sampling mechanism. It can be fine-tuned using the estimator
filter parameter.
OPTIONS
rate RATE
The maximum traffic rate of packets passing this action. Those exceeding it will be treated as defined by the conform-exceed option.
burst BYTES[/BYTES]
Set the maximum allowed burst in bytes, optionally followed by a slash ('/') sign and cell size which must be a power of 2.
mtu BYTES[/BYTES]
This is the maximum packet size handled by the policer (larger ones will be handled like they exceeded the configured rate). Setting
this value correctly will improve the scheduler's precision. Value formatting is identical to burst above. Defaults to unlimited.
peakrate RATE
Set the maximum bucket depletion rate, exceeding rate.
avrate RATE
Make use of an in-kernel bandwidth rate estimator and match the given RATE against it.
overhead BYTES
Account for protocol overhead of encapsulating output devices when computing rate and peakrate.
linklayer TYPE
Specify the link layer type. TYPE may be one of ethernet (the default), atm or adsl (which are synonyms). It is used to align the
precomputed rate tables to ATM cell sizes, for ethernet no action is taken.
estimator SAMPLE AVERAGE
Fine-tune the in-kernel packet rate estimator. SAMPLE and AVERAGE are time values and control the frequency in which samples are
taken and over what timespan an average is built.
conform-exceed EXCEEDACT[/NOTEXCEEDACT]
Define how to handle packets which exceed or conform the configured bandwidth limit. Possible values are:
continue
Don't do anything, just continue with the next action in line.
drop Drop the packet immediately.
shot This is a synonym to drop.
ok Accept the packet. This is the default for conforming packets.
pass This is a synonym to ok.
reclassify
Treat the packet as non-matching to the filter this action is attached to and continue with the next filter in line (if any).
This is the default for exceeding packets.
pipe Pass the packet to the next action in line.
EXAMPLES
A typical application of the police action is to enforce ingress traffic rate by dropping exceeding packets. Although better done on the
sender's side, especially in scenarios with lack of peer control (e.g. with dial-up providers) this is often the best one can do in order
to keep latencies low under high load. The following establishes input bandwidth policing to 1mbit/s using the ingress qdisc and u32 fil-
ter:
# tc qdisc add dev eth0 handle ffff: ingress
# tc filter add dev eth0 parent ffff: u32
match u32 0 0
police rate 1mbit burst 100k
As an action can not live on it's own, there always has to be a filter involved as link between qdisc and action. The example above uses
u32 for that, which is configured to effectively match any packet (passing it to the police action thereby).
SEE ALSO tc(8)iproute2 20 Jan 2015 Policing action in tc(8)