Q:

How do I use the output of an ls command in an if statement in a bash shell

I want to check if only one instance of a file exists before going on to process that file. 
I can check how many instances exist using this command: 
ls -l $INPUT_DIR/${INPUT_FILE_PREFIX}cons*.csv.gz | wc -l;

However, when I go to use this within an if statement, I am warned that the ls: command not found. 
if [ls -l $INPUT_DIR/${INPUT_FILE_PREFIX}cons*.csv.gz | wc -l = '1']
 then
 echo "Only 1 File Exists";
fi

I've tried adding a semicolon at the end of the ls command and enclosing it in square brackets - neither of these yielded any results. 
I very rarely have to do any Shell scripting, and I suspect this a very basic error, so any help would be much appreciated. 

A:

Change your if condition as below:
if [ "$(ls -l $INPUT_DIR/${INPUT_FILE_PREFIX}cons*.csv.gz | wc -l)" = "1" ]

There need to be a space after [ and before ]
Running the command within $() will invoke a subshell and run the command. 
Placing the $() within double-quotes will avoid error thrown in case of empty output. 

A:

You were almost there:
if [ $(ls $INPUT_DIR/${INPUT_FILE_PREFIX}cons*.csv.gz 2>/dev/null | wc -l) == 1 ]
 then
 echo "Only 1 File Exists";
fi

evaluates the result and compares with double equals.  Also, put spaces before and after square brackets. 
Also, filter out the case where no file matches (avoids no such file or directory error)
Note: you don't even need the -l option.  When outputting to a non-interactive terminal (i.e a file or a pipe), ls issues 1 line per file.  You can also force it with -C1 option.  You'll gain 3 nanoseconds (at least :)) not performing extra stat calls to get date, size, etc.. which are not needed.