In the following script everything works fine when I run it on a access point configure file but gives me this error when I run it on a bridge configure file where it doesn't need the frequency variable.

Error -> ./configure.sh: line 16: ${OUTPUT}: ambiguous redirect

Program call and source code

garrett@bedroom ~/Desktop/folder/project $ ./configure.sh system-2.4-BR.cfg GARRETT 111.111.111.111 MyNano 123.456.789.123 NewFrequency ~/Desktop/NEW.txt

Code:
#/bin/bash
#
# example: ./configure input-file, SSID, IP, device-name, gateway, frequency, output-file
#
FILE=${1}
SSID=${2}
IP=${3}
DEVICE=${4}
GATEWAY=${5}
FREQUENCY=""
OUTPUT=${7}

if [[ "${#} -eq 8" ]]; then # {
	FREQUENCY=${6}
fi
sed -e "s/\(empty-ssid\).*/${SSID}/g"      \
    -e "s/192\.168\.1\.20$/${IP}/g"        \
    -e "s/\(NanoBridge M.\)/${DEVICE}/g"   \
    -e "s/empty-frequency/${FREQUENCY}/g"  \
    -e "s/\(192\.168\.1\.1\).*/${GATEWAY}/g" ${FILE} > ${OUTPUT}
#END#