#!/usr/bin/bash if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then echo "Usage: $0 list file.zip" exit 1 fi LIST=$1 FILE=$2 LIST=$1 FILE=$2 while IFS= read -r line; do #echo "try: $line" if unzip -P "$line" -t "$FILE" >/dev/null 2>&1; then echo "FOUND: $line" break fi done < "$LIST" exit 0