Skip to content

Commit

Permalink
Change the readme documentation script
Browse files Browse the repository at this point in the history
  • Loading branch information
DyanGalih committed Dec 21, 2023
1 parent ae43880 commit 15fde4a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,23 @@ path=$1
# Read the file list.txt and store each line into the array search_strings
readarray -t search_strings < list.txt

# Declare an empty array to store the grep results
declare -a grep_results
# 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 All @@ -47,6 +59,7 @@ readarray -t unique_grep_results < <(printf '%s\n' "${grep_results[@]}" | sort -

# Display the unique results
printf '%s\n' "${unique_grep_results[@]}"

```

## Input File
Expand Down

0 comments on commit 15fde4a

Please sign in to comment.