Please use code tags when posting code.
The syntax error occurs because you're missing a semicolon between ']' and 'then'.
What is it you think this script snippet will achieve? Just grepping for "windows" in the output of fdisk isn't a guarantee of anything, and you're hard-coding the formatting of only /dev/sdb. If you're writing some sort of automation script you'll want a lot more sanity checks than this.