#I used to have this, but I don\'t want to write to the disk # pcap=\"somefile.pcap\" tcpdump -n -r $pcap > all.txt while read line; do ARRAY[$c]=\"$line\" c=$(
This works in bash:
while read line; do ARRAY[$c]="$line" c=$((c+1)) done < <(tcpdump -n -r "$pcap")