fork(1) download
  1. #!/bin/bash
  2. s="02/02/2020
  3. 08/25/1998
  4. 03/02/2030
  5. 12/02/2021
  6. 06/19/1960
  7. 01/10/2010
  8. 03/07/2100"
  9. while read line; do
  10. p1="$(sed -En 's,([0-9])([0-9])/([0-9])([0-9])/.*,\4\3\2\1,p' <<< "$line")";
  11. p2="${line##*/}";
  12. if [[ "$p1" == "$p2" ]]; then
  13. echo "$line"
  14. fi
  15. done <<< "$s";
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
02/02/2020
03/02/2030
12/02/2021