1
I received a zip file with a folder structure that include parenthesis. I've worked through two processes at the cli and now merge them into a script
The first searches through the file structure for specific files correcting the parenthesis then pipes to tshark to process. my output using sed works at the stoud but the pipe tshark doesn't like the path I'm throwing.
find <path> -iname *.cap |sed 's/(/\\(/' |sed 's/)/\\)/'
takes folder/folder(description)/file.cap results in folder/folder(description)/file.cap cool!
when I add this to a bash script
#/BIN/BASH
capfiles=($(find <path> -iname *.cap | sed ’s/(/\\(/‘ |sed ’s/)/\\)/‘))
for i in “${capfiles[@]}”;do
tshark -r $i -T fields -e dns.qry.name |sort u > $i.uniquefqdns2lookup.txt
done
I get
'tshark: The file "folder/folder\(description\)/file.cap" doesn't exist.
'tshark: The file folder/folder\(description\)/file.cap" doesn't exist.
'tshark: The file folder/folder\(description\)/file.cap" doesn't exist.
I've tried playing with ./ in the patch as an explicit character with no luck. that output looks like:
'tshark: The file "./"folder/folder\(description\)/file.cap" doesn't exist.
'tshark: The file "./folder/folder\(description\)/file.cap" doesn't exist.
'tshark: The file "./folder/folder\(description\)/file.cap" doesn't exist.
What am I missing? Am i totally off with this?
change
#/BIN/BASH
to#!/bin/bash
. – αғsнιη – 2014-12-23T15:40:01.987