The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com



Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need to get pid of a process and have to store the pid in a variable samudha UNIX for Dummies Questions & Answers 7 08-05-2008 03:24 AM
How to store the values in a file into an array risshanth UNIX for Dummies Questions & Answers 3 01-22-2008 10:34 AM
To store the output in a variable Sudhakar333 Shell Programming and Scripting 2 07-10-2007 08:45 AM
store awk results in a variable forever_49ers Shell Programming and Scripting 1 09-19-2006 10:51 PM
how do I store the values in array using shell krishna UNIX for Advanced & Expert Users 2 08-17-2001 09:49 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-04-2008
chittiprasad15 chittiprasad15 is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 2
Smile How to store values into variable in perl

Hi,

Can you please help me of how to store the values into variables.

Here is the output in LINUX for the below command.

$free

output :
total used free
Mem: 3079276 3059328 19948
Swap: 1023992 6324 1017668

while i am trying the below commands i got the ouput
free |grep "Mem:" |awk ' {print $2}'
output for the above cmd is printing == 3079276

similar to the swap as well..

But i want to store the ouput value in a variable

I also decalred the variable like this

$Memory=`free |grep "Mem:" |awk ' {print $2}'`;
print "$Memory ";
It is printing like this
Mem: 3079276 3059328 19948

Can anyone please help me regarding this how to store the values into variables....
 

Bookmarks

Tags
linux commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0