#! /usr/bin/python import sys import commands sys.stdout.write("Checking if there is enough available RAM\t\t\t" ) a=commands.getstatusoutput("free -m | grep 'Mem:' | awk '{split ($0,a); print a[2]}' ") a=a[1]; #extracting needed info try: if a