Evaluating command output (shell script )

Hello, in a script i would like to evaluate a command output with a grep, for example, to know if the parameter defined by the user is in the output.

Something like: the_command | grep $1

Please, how is the way to evalulate in this a script, like

if [ the_command evaluation (grep) ]
echo "incorrect parameter, not in the list of allowed values"
exit
fi

Just a sample of what you can do...
<code>
#!/usr/bin/ksh

#Test params
if [ $# -eq 0 ];
then
echo "No params!"
echo "Usage : $0 params..."
exit 1
else
#Count the params
echo "You have $# arguments"
echo "The params are $@"

    for i in "$@"
    do
            if [ -f $i ]; \(In case of looking if its a file... \)
            then
                    echo " file $i exists"
                 ...
            else
                    echo "fie $i missing"
                    exit 1
            fi
    done

fi
</code>

Very useful, thank you very much.