hi everyone,
im trying to write a shell script that calculates memory usage of several processes (i basically run bash several times). here's the script:
#!/usr/bin/bash
memUsage=`ps -ef | grep bash| awk '{sum+= $2}'`
echo $memUsage
if $memUsage>130000000000000 ; then
echo "mem usage exceeded"
else
echo "mem usage normall"
fi
exit 0
first of all, echo doesn't print the value of memUsage.
second of all, no matter what i enter after ">" (1, 130 or 13000000000), it always echos "mem usage exceeded" and exits.
can someone please tall what im doing wrong before i'll lose it?
thank you