Q:

Syntax error in shell script

I have a small shell script that performs a very simple task
#!/bin/bash
while read LINE; do
  output=$(curl -iL --head "$LINE" | grep laravel)
  if [[ $output ]] && echo "$LINE"
done < url-list.txt

I pass a file called url-list.txt to the script, and it outputs a file that contains a subset of the urls from the original file that match the grep laravel. 
However, I seem to have a syntax error in the script:
$ ./processurls.sh > laravel.txt
./processurls.sh: line 5: syntax error near unexpected token `done'
./processurls.sh: line 5: `done < url-list.txt'

Can someone help me debug this, as it should be rather simple, but I am confused as to what the correct syntax would be.
Also, is there a better way to do this?
What I am trying to do is determine which sites (out of a list of approximately 1000 sites) are using what platform or framework.
Naturally, I realise that there are limitations to sniffing out the platforms and frameworks, but I need to gather statistics on various sites for the purposes of providing a report to a client.
Specifically, I need to try and see how many of these sites are using Joomla, Drupal, Wordpress or a PHP Framework such as Laravel, Code Ignitor, Symfony2, CakePHP and FuelPHP.
I assumed that this script could be modified multiple times to replace the grep search with a new term and then run the script with a different output file for each search term.

A:

Your if statement is wrong, it has to be
if <test>; then
    <block>
fi

What you want to do (<test> && <somethingelse>) isn't an if but an boolean expression:
[[ $output ]] && echo "$LINE"

