07-17-2013
This is quite different from what you posted in post #1. Where/what is the service, presented in post#1, missing in post #6? What is num, appearing suddenly in post #6? Where ist the country, and where is the 4-item-structure you confirmed in post #4?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What can i do to check that the input is all alphabet.. ? (4 Replies)
Discussion started by: XXXXXXXXXX
4 Replies
2. Shell Programming and Scripting
HI all,
I would like to know how the user can be restricted for entering only the number and not characters in sheel scripts..
Suppose code is like this
echo 'Enter the number'
read Value
Now user may enter 'a' as value...
But i want to disallow him for entering characters other than... (3 Replies)
Discussion started by: dhananjaysk
3 Replies
3. UNIX for Dummies Questions & Answers
how to check whether a given input is a number or a string? (1 Reply)
Discussion started by: Shilpi
1 Replies
4. Shell Programming and Scripting
Hi All,
I have a table with 10 columns. Some columns(2nd,4th,5th,7th,8th and 10th) are Not Null columns. I'll get a tab-delimited file and want to check col by col and generate seperate error code for each col eg:102 if 2nd col value is NULL and 104 if 4th col value is NULL so on... I am a... (7 Replies)
Discussion started by: Mandab
7 Replies
5. Programming
Suppose we have a simple situation, like the following C++ instructions:
int x;
cout << "Insert x: ";
cin >> x;
while ( x-- < 0 ) ;
Of course, if it is written something different from an integer, the while loop shall not end.
So, how can we check if the input x is of the right type? (2 Replies)
Discussion started by: Luke Bonham
2 Replies
6. Shell Programming and Scripting
Hi,
I have a script which runs daily. It gets 3 input files test1,test2,test3. I want to do a validation in my script to make sure i have all the 3 files available before running. If any one of the file is missing i want to break the script.
Could you please help me with this request.
... (1 Reply)
Discussion started by: Krrishv
1 Replies
7. Shell Programming and Scripting
Hi,
I need my script to check if the user enters 3 values if not 5 values to my script and alert if the input has any other number of values.
for example:
./myscript.sh 22 56 3221 - > correct
./myscript.sh 22 56 3221 45 777 -> correct
./myscript.sh 22 56 3221 45 -> incorrect
Please... (6 Replies)
Discussion started by: mohtashims
6 Replies
8. Shell Programming and Scripting
Hello there, find below for my code first:
$pdp_asaba=`cat /tmp/temp_total | grep asaba | sed 's/*//g'`
if ]]
then pdp_asaba=0
fi
$pdp_abuja=`cat /tmp/temp_total | grep abuja | sed 's/*//g'`
if ]]
then pdp_abuja=0
fi
$pdp_ojota=`cat /tmp/temp_total | grep ojota | sed 's/*//g'`
if ... (3 Replies)
Discussion started by: infinitydon
3 Replies
9. Shell Programming and Scripting
Hi,
My input file
Gene1 1
Gene1 2
Gene1 3
Gene1 0
Gene2 0
Gene2 0
Gene2 4
Gene2 8
Gene3 9
Gene3 9
Gene4 0
Condition:
If the first column matches, then look in the second column. If there is a value of zero in the second column, then don't consider that record while averaging.
... (5 Replies)
Discussion started by: jacobs.smith
5 Replies
10. Shell Programming and Scripting
Hi dears
i use bash shell
i have INPUT.txt
like this
number of columns different in one
some row have 12 , some 11 columns
see last column
INPUT.txt
CodeGender Age Grade Dialect Session Sentence Start End Length Phonemic Phonetic
63 M 27 BS/BA TEHRANI 3 4 298320 310050... (2 Replies)
Discussion started by: alii
2 Replies
Packet sample action in tc(8) Linux Packet sample action in tc(8)
NAME
sample - packet sampling tc action
SYNOPSIS
tc ... action sample rate RATE group GROUP [ trunc SIZE ] [ index INDEX ]
tc ... action sample index INDEX
DESCRIPTION
The sample action allows sampling packets matching classifier.
The packets are chosen randomly according to the rate parameter, and are sampled using the psample generic netlink channel. The user can
also specify packet truncation to save user-kernel traffic. Each sample includes some informative metadata about the original packet, which
is sent using netlink attributes, alongside the original packet data.
The user can either specify the sample action parameters as presented in the first form above, or use an existing sample action using its
index, as presented in the second form.
SAMPLED PACKETS METADATA FIELDS
The metadata are delivered to userspace applications using the psample generic netlink channel, where each sample includes the following
netlink attributes:
PSAMPLE_ATTR_IIFINDEX
The input interface index of the packet, if there is one.
PSAMPLE_ATTR_OIFINDEX
The output interface index of the packet. This field is not relevant on ingress sampling
PSAMPLE_ATTR_ORIGSIZE
The size of the original packet (before truncation)
PSAMPLE_ATTR_SAMPLE_GROUP
The psample group the packet was sent to
PSAMPLE_ATTR_GROUP_SEQ
A sequence number of the sampled packet. This number is incremented with each sampled packet of the current psample group
PSAMPLE_ATTR_SAMPLE_RATE
The rate the packet was sampled with
OPTIONS
rate RATE
The packet sample rate. RATE is the expected ratio between observed packets and sampled packets. For example, RATE of 100 will lead
to an average of one sampled packet out of every 100 observed.
trunc SIZE
Upon set, defines the maximum size of the sampled packets, and causes truncation if needed
group GROUP
The psample group the packet will be sent to. The psample module defines the concept of groups, which allows the user to match spe-
cific sampled packets in the case of multiple sampling rules, thus identify only the packets that came from a specific rule.
index INDEX
Is a unique ID for an action. When creating new action instance, this parameter allows to set the new action index. When using
existing action, this parameter allows to specify the existing action index. The index must 32bit unsigned integer greater than
zero.
EXAMPLES
Sample one of every 100 packets flowing into interface eth0 to psample group 12:
tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: matchall
action sample rate 100 group 12 index 19
Use the same action instance to sample eth1 too:
tc qdisc add dev eth1 handle ffff: ingress
tc filter add dev eth1 parent ffff: matchall
action sample index 19
SEE ALSO
tc(8), tc-matchall(8) psample(1)
iproute2 31 Jan 2017 Packet sample action in tc(8)