Can someone tell me what is wrong with this loop?

enter image description here

The error that I have is on the line 107 (first line of the loop). It says:

[V2016057174800: command not found.

I am trying to associate two the same filename from two different documents (if that makes sense).

  • 4
    [ is a command itself, and needs a space after it (you'll also need a space before the ]). Please paste in text instead of using a screenshot, too. – user4443 Jul 12 '17 at 19:44

Your formatting is very strange! You probably want to fix that first to make this code somewhat readable! That said, your problem is the lack of spaces around [ and ].

These characters [ ] are actually just shorthand for the command test. You should change the first line to read as follows:

in bash

if [[ "$L1Aname" == "$filename" ]]; then


in POSIX shells

if [ "$L1Aname" = "$filename" ]; then

inside both of which examples, each character maters:

For example spaces: there need to be spaces around [ and ].

Plus notice the subtle difference between bash and POSIX in the double / single =.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.