📄 rpm-check.sh
字号:
#!/bin/bash# rpm-check.sh# Queries an rpm file for description, listing,#+ and whether it can be installed.# Saves output to a file.# # This script illustrates using a code block.SUCCESS=0E_NOARGS=65if [ -z "$1" ]then echo "Usage: `basename $0` rpm-file" exit $E_NOARGSfi { # Begin code block. echo echo "Archive Description:" rpm -qpi $1 # Query description. echo echo "Archive Listing:" rpm -qpl $1 # Query listing. echo rpm -i --test $1 # Query whether rpm file can be installed. if [ "$?" -eq $SUCCESS ] then echo "$1 can be installed." else echo "$1 cannot be installed." fi echo # End code block.} > "$1.test" # Redirects output of everything in block to file.echo "Results of rpm test in file $1.test"# See rpm man page for explanation of options.exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -