title: I want a for loop script to do some commands in every numbered subdirectory (1-400)
body: <p>I am looking for "for loop" to run multiple script in each direcorty and save the output in the same directory</p>
  
  <pre><code>#!/bin/bash
  
  
  for dir in /home/Desktop/4Testing/batch_2019-05-16/*     # inside batch_2019-05-16 there are 400 folders"
  do
      dir=${dir%*/}      # remove the trailing "/"
  echo "$1" *.pcap &gt; 12.txt   # print everything after the final "/"
  tshark -r *.pcap -T fields -e frame.time -e _ws.col.Source -e _ws.col.Destination -e frame.len -e _ws.col.src.prt -e _ws.col.dst.prt -E separator=, &gt; home.csv      
  cat home.txt 12.txt &gt; Final.csv
  done
  </code></pre>