I am building a script with
usr/bin/time program to monitor the RAM usage of a script and storing it in a variable so i can check if it is higher than a specified limit
$mlimit, like this example using
ls / as the command:
I am building a script with usr/bin/time program to monitor the RAM usage of a script and storing it in a variable so i can check if it is higher than a specified limit $mlimit, like this example using ls / as the command:
/usr/bin/time in this case returns first the output of the command and then the maximum resident set size (RAM usage). I thought then i could reverse the output, cut it to get the ram usage and reverse it back. But i get this output:
RAM usage: bin.
bin is the first directory returned by the
ls / command. So my strategy to get the RAM usage is not working.
Thanks