Advertisement
STANAANDREY

solab3pb2

Mar 1st, 2024 (edited)
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $# -ne 2 ]; then
  4.     echo "Usage $0 <input_file> <output_file>"
  5.     exit 1
  6. fi
  7.  
  8. regex='^https*:\/\/[a-zA-Z0-9\.\-]+[(.com)|(.ro)|(.eu)];([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
  9.  
  10. > $2
  11. while IFS= read -r line; do
  12.     if [[ $line =~ $regex   ]]; then
  13.         echo "OK" >> $2;
  14.     else
  15.         echo "ERROR" >> $2;
  16.     fi
  17. done < $1
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement