[root@station shell]# cat 5.sh
#!/bin/bash
SUCCESS=0
ERROR_NARGS=65

if [ -z $1 ]
then
        echo "usage: `basename $0` rpm-file"
        exit $ERROR_NARGS
fi

{
        echo
        echo "Achive Description"
        rpm -qpi $1
        echo
        echo "Achive Listing"
        rpm -qpl $1
        echo
        rpm -i --test $1
        if [[ "$?" -eq "$SUCCESS" ]]
        then
        echo "$1 can be installed"
        else
        echo "$1 can not be installed"
        fi
        echo
} > "/root/shell/$1.test"
echo "result of rpm test in file $1.test"
exit 0