[RULE] [Fwd: Re: Disk space used by a package?]

Ingo Lantschner ingo.lists at vum.at
Fri Oct 22 23:30:01 EEST 2004


On Fri, 22 Oct 2004 20:05:28 +0200, Ingo Lantschner <ingo.lists at vum.at>  
wrote:


> All we would need is some function to add the many numbers from  
> "ergebnis".
I tried it with math-functions from bash. Problem: fssize seems to be an  
integer.

This code:
    #!/bin/sh
    declare -i x   			 # x is integer
    let x=0
    let y=0       			       # y is string
    echo " Int | String"
    for rpm in `grep -v '^--' $1`
    do
       rpm -qp --qf "[%{fssizes} \n]" $rpm
       x=`rpm -qp --qf "[%{fssizes}]" $rpm`
       y=`rpm -qp --qf "[%{fssizes}]" $rpm`
       echo "$x | $y"
       echo "------------------------------------"
    done;


Shows this output:

$ ~/.scripts/chkrpmsize.sh  
/sl/slinky-0.4.05/filesystem/scripts/3/all_packages.disc1 2> /dev/null
  Int | String
1179325
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
5780536899596517376 | 11793250000000000000000
------------------------------------
190713288
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-2202804535703371776 | 1907132880000000000000000
------------------------------------

etc.

Any idea pls. how to get numeric values from rpm/script which can be  
calculated by bash?!

TIA, Ingo.


_______________________________________________
Original home page of the RULE project: www.rule-project.org
Rule-list at rule-project.org
http://mail.rule-project.org/mailman/listinfo/rule-list_rule-project.org



This full static mirror of the Run Up to Date Linux Everywhere Project mailing list, originally hosted at http://lists.hellug.gr/mailman/listinfo/rule-list, is kept online by Free Software popularizer, researcher and trainer Marco Fioretti. To know how you can support this archive, and Marco's work in general, please click here