Try help [ then help test -- [ is a synonym for test, and the test help says:
The behavior of test depends on the number of arguments.
With this: [ find "$MAINTENANCE_LOCK/testLOCK" -mtime -1 ];
you're passing 4 words to [, and it doesn't know what to do with 4 arguments.
I am attempting to check if a specific file exists (but only if less than 24 hours old), and if so, perform a second check to see if a file with a name ending in ".control" exists.
With bash:
mapfile -t testlock < <(find "$MAINTENANCE_LOCK/testLOCK" -mtime -1) if [[ ${#testlock[@]} -eq 10 ]]; then echo "lock file does no exist or is too old" else control=( "$PATH_TO_TRIGGER_FILES/"*.control ) if [[ ${#control[@]} -gt 0 ]]; then echo "lock file exists and at least one control file exists" else echo "lock file exists but no control files exist" fi else echo "lock file does no exist or is too old" fi