I made this script to close a process, but I can't compare the awk result (var1) with an Integer: var1 -gt 5000.My script:#!/bin/bashvar1= free -m |awk 'NR == 2'| awk '{print $3}'var2= ps aux | grep '/opt/skype/skype' | grep -v grep | awk '{print $2}'while true;do     if [ $var1 -gt 5000 ]; then         echo La memoria se ha excedido cerrando porcesos         kill -9 $var2     break     else     echo La memoria aun es estable $var1     fidoneCould it be a casting problem in bash?
Bash: kill process in function of the memory used
bash;shell script
You can cast variables in bash and ksh (use declare -i var or typeset -i var for interger), but I don't think that is your problem.The following will set var1 to nothing while then running the command as normal.var1= free -m |awk 'NR == 2'| awk '{print $3}'If you want the output of free and awk to be set to var1 then the above should read:var1=$( free -m |awk 'NR == 2'| awk '{print $3}' )