Changes

Jump to: navigation, search

OPS235 Lab 3 - CentOS7

157 bytes added, 07:39, 8 April 2015
no edit summary
::   echo "USAGE: $0 [application-name]" >&2
::   exit 1
::fi<br><br>::&#35; 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>::&#35; Convert spaces to pipe symbol (|)::processedChoice=$(echo $choice | sed 's/ /|/g')<br><br>::&#35; Use sed with extended regular expressions to only print those matching report elements::rpm -qi $1 | sed -r -n "/($processedChoice)/ p" &gt;&gt; /root/package-info.txt<br><br>
::cat &lt;&lt;+
::File "/root/package-info.txt" can been created
13,420
edits

Navigation menu