+ cd /tmp/dir
./a.sh: line 6: syntax error in conditional expression
./a.sh: line 6: syntax error near `='
./a.sh: line 6: ` if [[ -f "$i" = "345.zip"]]'
If you want to know if the file named by the contents of the variable named i is a regular file, use:
if [[ -f "$i" ]]
If you want to know if the string that is the contents of the variable named i is the string 345.zip , use:
if [[ "$i" == "345.zip"]]
If you want to know if the file named by the contents of the variable named i is a regular file named 345.zip use:
if [[ -f "$i" ]] && [[ "$i" == "345.zip"]]
Then note that with your loop (if you have three files one of which is named 345.zip that match the filename matching pattern *.* ) you'll echodo nothing once and echo do something twice. Is that really what you want to do?