check_rpm.sh

#!/bin/bash
#rpm_check.sh
SUCCESS=0
E_NOARGES=65
if [ -z $1 ]
	then
	echo "Usage:`basename $0` rpm-file"
	exit $E_NOARGES
	fi
{
 echo
 echo "Archive Description:"
 rpm -qpi $1
 echo
 echo "Archive 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 
	} > "$1.test"
exit 0

练习shell


你可能感兴趣的:(shell,archive)