OSQA is unmaintained. Help us figure out where to go from here.

Thanks. Maybe this is another question:

I wrote a script to deal with multiple files as follows:

#!/bin/bash
for file in 'datadir/*'
do
    tshark -r $file -R '(ip.addr eq 10.0.072 and ip.addr eq 10.0.1.102) and (udp.port eq 65505 and udp.port eq 4005)' -T fields -e data | tr -d '\n' > $file.raw

if only 1 file in the datadir, i got one output file, but it fails if the files in datadir more than one.

Here is the message from system: tshark: Read filters were specified both with "-R" and with additional command-line arguments

Have i done something wrong?

Thanks for any hint.

asked 13 Jul, 19:24

tree0520's gravatar image

tree0520
63
accept rate: 0%

converted to question 13 Jul, 22:42

Jaap's gravatar image

Jaap ♦
11.6k16101

Your answer has been converted to a question as that's how this site works. Please read the FAQ for more information.

(13 Jul, 22:43) Jaap ♦

I guess your for loop is wrong: the file variable contains a list of all files.

Better run:

for file in `ls -1 datadir/*`

Furthermore, when calling tshark with '-R' you also have to use '-2' or use single-pass filtering with '-Y'

permanent link

answered 14 Jul, 04:14

Uli's gravatar image

Uli
8781515
accept rate: 28%

Well, as for me, the correct syntax would be

for file in datadir/*

or

for file in $(ls datadir/*)
(14 Jul, 08:46) sindy
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×829

question asked: 13 Jul, 19:24

question was seen: 171 times

last updated: 14 Jul, 08:46

p​o​w​e​r​e​d by O​S​Q​A