bc will round the value down,  you need to change your calculation to round up  or using a different scale.<div><br></div><div>You would need to try it out, maybe something in the spirit of :</div><div><br></div><div>echo "scale 1; $memKB/1024.... |bc</div>
<div>if memGB -ge 5.5 ...</div><div><br></div><div>Ohad</div><div><br></div><div><br><div class="gmail_quote">On Tue, Dec 21, 2010 at 2:18 PM, Patrick Lists <span dir="ltr"><<a href="mailto:ks-list@puzzled.xs4all.nl">ks-list@puzzled.xs4all.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I trying to create a kickstart script on CentOS 5.5 that installs an RPM<br>
depending on the amount of memory in the box. For example if the box has<br>
>= 6GB memory then install RPM2 else install RPM1. With some Googling I<br>
now have the following snippet:<br>
<br>
%pre<br>
memKB=$(free|grep Mem|awk '{print$2}')<br>
memGB=$(echo "($memKB/1024)/1024"|bc)<br>
BIGMEM=""<br>
if [ "$memGB" -ge 6 ]; then<br>
    BIGMEM="6GB"<br>
fi<br>
<br>
%post<br>
yum install foobar$BIGMEM-1.0-1.rpm<br>
<br>
The problem is that on a box with 6GB memory this snippet says it does<br>
not have 6GB mem:<br>
<br>
memKB = 6123716 KB<br>
memGB = 5 GB<br>
<br>
Anyone know what I am doing wrong?<br>
<br>
Thanks!<br>
Patrick<br>
<br>
_______________________________________________<br>
Kickstart-list mailing list<br>
<a href="mailto:Kickstart-list@redhat.com">Kickstart-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/kickstart-list" target="_blank">https://www.redhat.com/mailman/listinfo/kickstart-list</a><br>
</blockquote></div><br></div>