Setting variable must the whole set to be in 1st argument.
Which shell you are using ?
If you have not old bsh, then you can write without using external expr.
Always add the correct shell to the 1st line in script, no need to take care of your interactive "keyboard" shell and for us it's easier to give solution.
Made changes to a file using vi editor and saved those changes
now realised that the changes are not required
How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Hi,
I have a file (details.txt) with 3 rows of variables ie...
name postcode age
john D fr25dd 25
mark W ab122aa 22
phil C cd343bb 33
What I want to do is read down the list with a loop and add each field into a one line piece of text...
So I have a file (test1) which reads;... (3 Replies)
I am writing a shell script using the korn shell. It seems that I am only
able to use local variables within a while loop that is reading a file.
(I can't access a variable outside a previously used while loop.) It's been
a while since I wrote shell scripts. Here is a sample
cat file.txt... (4 Replies)
Hi,
Here is the output of lpstat. I would like to read value of Queue which is(abxxxxb1)and status that is DOWN in first line. i dont care what is in second line. any one can help me.thanks
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- ---------... (5 Replies)
Hi,
I am building a script to grep for a string in all the files from a folder and display the results.
I am reading the files one by one by placing the names in other file using while loop
my code is as below
while read inp
do
chk=`grep -c "$str" $pth/$inp`
... (2 Replies)
Hi,
I am on HP-UX and K shell.
When I am using while/for loop for reading a file. It is working fine but not reading tabs:
Suppose, if the line is: ; ;COMP; ; ; ;
then loop is reading as
; ;COMP; ;... (5 Replies)
Hi
Am trying to print the PIDs of process in a file and trying to grep any PID from that file
I set the if condition as $value != "PID" and $value != "-"
Assign that number to a variable
Am confused since am using while loop to read the line from file
and again if condition to check those... (2 Replies)
Hi,
I am writing in a file through cat command. This file will contain the path of file along with filename. e.g. /home/user/folder1/folder2/filename.txt
There might be very large number of this path in same file like say 140
when I try to run while command:
while read -r file
do
//command... (8 Replies)
Hello All,
I have two files with me file1.txt and file2.txt
file1.txt has:
333
222
111
file2.txt has
ccc
bbb
aaa
ccc is related to 333 only, bbb is related to 222 only and aaa is related to 111 only.
I have to get the values from each of the file and pass them in the URL... (3 Replies)
Cope sample1: test.sh
i=0
echo " Outside loop i = $i "
while
do
i=$(( $i + 1))
echo "Inside loop i = $i "
done
echo " Out of loop i is : $i "
When run output :
Outside loop i = 0
Inside loop i = 1
Inside loop i = 2
Inside loop i = 3
Inside loop i = 4
Inside loop i = 5
Inside... (8 Replies)
Discussion started by: Adarshreddy01
8 Replies
LEARN ABOUT DEBIAN
ldns-dpa
dpa(1) General Commands Manual dpa(1)NAME
dpa - DNS Packet Analyzer. Analyze DNS packets in ip trace files
SYNOPSIS
dpa [ OPTION ] TRACEFILE
DESCRIPTION
dpa is used to analyze dns packets in trace files. It has 3 main options: count, filter, and count uniques (i.e. count all different
occurences).
OPTIONS -c expressionlist
Count occurrences of matching expressions
-f expression
Filter: only process packets that match the expression
-h Show usage
-p Show the total number of correct DNS packets, and percentage of -u and -c values (of the total of matching on the -f filter. if no
filter is given, percentages are on all correct dns packets)
-of file
Write all packets that match the -f flag to file, as pcap data.
-ofh file
Write all packets that match the -f flag to file, in hexadecimal format, readable by drill.
-s Show possible match names
-s matchname
show possible match operators and values for name
-sf Only evaluate packets (in representation format) that match the -f filter. If no -f was given, evaluate all correct dns packets.
-u matchnamelist
Count every occurence of every value of the matchname (for instance, count all packetsizes, see EXAMPLES in ldns-dpa(1) ).
-ua For every matchname in -u, show the average value of all matches. Behaviour for match types that do not have an integer value is
undefined.
-uac For every matchname in -u, show the average number of times this value was encountered.
-um number
Only show the results from -u for values that occurred more than <number> times.
-v level
Set verbosity to level (1-5, 5 being the highest). Mostly used for debugging.
-notip file
Write packets that were not recognized as IP packets to file (as pcap data).
-baddns file
Write dns packets that were too mangled to parse to file (as pcap data).
-version
Show version and exit
LIST AND MATCHES
A <matchnamelist> is a comma separated list of match names (use -s to see possible match names). A <expressionlist> is a comma separated
list of expressions.
An expression has the following form: <expr>: (<expr>)
<expr> | <expr>
<expr> & <expr>
<match>
<match>: <matchname> <operator> <value>
<operator>: = equal to <value> != not equal to <value> > greater than <value> < lesser than <value>
>= greater than or equal to <value> <= lesser than or equal to <value> ~= contains <value>
See the -s option for possible matchnames, operators and values.
EXAMPLES
ldns-dpa -u packetsize -p test.tr
Count all different packetsizes in test.tr and show the precentages.
ldns-dpa -f "edns=1&qr=0" -of edns.tr test.tr
Filter out all edns enable queries in test.tr and put them in edns.tr
ldns-dpa -f edns=1 -c tc=1 -u rcode test.tr
For all edns packets, count the number of truncated packets and all their rcodes in test.tr.
ldns-dpa -c tc=1,qr=0,qr=1,opcode=QUERY test.tr
For all packets, count the number of truncated packets, the number of packets with qr=0, the number of packets with qr=1 and the
number of queries in test.tr.
ldns-dpa -u packetsize -ua test.tr
Show all packet sizes and the average packet size per packet.
ldns-dpa -u srcaddress -uac test.tr
Show all packet source addresses and the average number of packets sent from this address.
sudo tcpdump -i eth0 -s 0 -U -w - port 53 | ldns-dpa -f qr=0 -sf
Print all query packets seen on the specified interface.
AUTHOR
Written by Jelte Jansen for NLnetLabs.
REPORTING BUGS
Report bugs to <jelte@nlnetlabs.nl>.
COPYRIGHT
Copyright (C) 2005 NLnet Labs. This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR-
POSE.
1 Nov 2005 dpa(1)