Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting this EOF error when running this bash script

Tags:

bash

I am a noob to scripting in bash.

Here are the two errors I keep getting: line 16: unexpected EOF while looking for matching `"' line 18: syntax error: unexpected end of file

For line 16 the " is matching I'm not even sure what is wrong with 18 at all Any help would be much appreciated.

#!/bin/bash
# Script for Capture
# sudo tshark -i2 -f "tcp" -P -S -l -w mbcap.pcap

_now=$(date +"%m_%d_%Y")
_file="~/captures/$_now.pcap"
echo "Starting capture to $_file..."
echo "Creating Output Directory as: $_file
touch $_file
chmod 666 $_file

echo "Which Interface Would you like to capture on:"
sudo tshark -D
read selection

sudo tshark -i$selection -f "tcp" -P -S -l -w $_file
like image 933
MikeBanks Avatar asked Dec 07 '25 06:12

MikeBanks


1 Answers

You are missing a closing " on the line where you're outputting:

echo "Creating Output Directory as: $_file
like image 164
Vinay Avatar answered Dec 08 '25 23:12

Vinay