"Fossies" - the Fresh Open Source Software Archive

Member "systeminfo/report/rpm.sh" (4 Feb 2005, 684 Bytes) of package /linux/privat/old/systeminfov12.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 # RAM Packages Availablity Notifier
    3 cnt=`rpm -qa | wc -l`
    4 let findex=cnt/3
    5 let sindex=findex+1
    6 let mindex=sindex+findex
    7 let tindex=mindex+1
    8 
    9 i=0
   10 while read line; do
   11 echo $line | grep -q 'colspan="1">'
   12 if [[ $? -eq 0 ]]
   13 then
   14     echo $line
   15     let i=i+1
   16     if [[ $i -eq 1 ]]; then
   17         rpm -qa | sed -n "1,$findex p" | while read ln; do
   18         echo $ln"<br>"
   19     done
   20     elif [[ $i -eq 2 ]]; then
   21         rpm -qa | sed -n "$sindex,$mindex p" | while read ln; do
   22         echo $ln"<br>"
   23     done
   24     elif [[ $i -eq 3 ]]; then
   25         rpm -qa | sed -n "$tindex,$cnt p" | while read ln; do
   26         echo $ln"<br>"
   27     done
   28     fi
   29 else
   30     echo $line
   31 fi
   32 done < rpm.html > $1/rpm.html