Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mayur1064/selenium-demo-bot


https://github.com/mayur1064/selenium-demo-bot

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        

#!/bin/bash

# Grep the file for all matching lines
matches=$(grep "your_search_pattern" your_file.txt)

# Loop through each line found by grep
while IFS= read -r line; do
# Extract the second word from each line
second_word=$(echo "$line" | awk '{print $2}')

# Check if the second word contains a specific substring
if [[ "$second_word" == *"substring"* ]]; then
echo "Match found: $second_word contains 'substring'"
else
echo "No match: $second_word does not contain 'substring'"
fi
done <<< "$matches"

echo "This is a sample line" | awk -F'start_string|end_string' '{print $2}'

grep 'pattern' input_file | awk '{split($3, a, "start_string|end_string"); print $1, a[2], $4}'

awk '{
if (prev && /pattern/) {
print prev_words[3], prev_words[4], $2, $4; # Print 3rd and 4th words from the previous line and 2nd and 4th words from the current line
}
split(prev, prev_words); # Split the previous line into words
prev = $0; # Store the current line as previous
}' input_file