Skip to content

Commit

Permalink
Adding progress information
Browse files Browse the repository at this point in the history
  • Loading branch information
DyanGalih committed Dec 21, 2023
1 parent 68d8f01 commit ae43880
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,23 @@ path=$1
# Read the file list.txt and store each line into the array search_strings
readarray -t search_strings < list.txt

# Get the total number of search strings
total=${#search_strings[@]}

# Create an empty array to store the grep results
grep_results=()

# Initialize a counter
counter=0

# Loop through each search string in the array
for string in "${search_strings[@]}"; do
# Increment the counter
((counter++))

# Print the current position and total
echo "Scanning string $counter of $total: $string"

# Run the grep command with the current search string and store the results in the array grep_results
while IFS= read -r line; do
grep_results+=("$line")
Expand Down

0 comments on commit ae43880

Please sign in to comment.