13,420
edits
Changes
no edit summary
:: echo "USAGE: $0 [application-name]" >&2
:: exit 1
::fi<br><br>::# Creates report title (echo with -e option allows newline \n character to be used)<br><br>
::echo -e "\nSOFTWARE PACKAGE INFORMATION REPORT" > /root/package-info.txt
::echo -e "Date: $(date +'%A %B %d, %Y (%H:%M:%p)')\n\n " >> /root/package-info.txt
::+
<br>
::read -p "Enter word(s) shown above separated by spaces: " choice<br><br>::# Convert spaces to pipe symbol (|)::processedChoice=$(echo $choice | sed 's/ /|/g')<br><br>::# Use sed with extended regular expressions to only print those matching report elements::rpm -qi $1 | sed -r -n "/($processedChoice)/ p" >> /root/package-info.txt<br><br>
::cat <<+
::File "/root/package-info.txt" can been created