Join Today
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Location
    UK
    Posts
    1,145

    Default Bash script to read free RAM

    Hello all,

    I requried a spot of help. I need a bash script to read only the free RAM from the command free and store it in a variable. I know we need to use awk or gawk, but I'm unsure on the syntax.

    This does'nt seem to be working on the E6 :
    Code:
    echo "$( free -mto | grep Mem: | busybox awk '{ print $4 " MB" }')"
    Regards,
    Akshay

  2. #2
    Join Date
    Mar 2008
    Location
    Izhevsk, Russia
    Posts
    1

    Default

    Is this what you want?
    Code:
    my_var="$( free -m | grep Mem: | busybox awk '{ print $4 " MB" }')"

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    1,145

    Default

    Let me test it out and get back to you . Thanks.
    Last edited by aksd; 06-11-2008 at 02:13 PM.
    Regards,
    Akshay


 
+ Reply to Thread

Similar Threads

  1. Replies: 35
    Last Post: 07-09-2010, 01:38 PM
  2. E6 ram ??
    By the_bloods_city in forum E6 General Chat
    Replies: 12
    Last Post: 07-15-2009, 07:44 AM
  3. Help: bash script and "showFolder" binary
    By amin in forum Scripting
    Replies: 3
    Last Post: 06-25-2008, 12:47 AM
  4. Urgent Help: About Bash scripts...
    By amin in forum Scripting
    Replies: 4
    Last Post: 04-29-2008, 05:15 PM
  5. missing humor in bash
    By swifty in forum Linux
    Replies: 5
    Last Post: 11-20-2007, 01:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Optimization by vBSEO 3.6.0 RC 1