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 > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com



UNIX Desktop for Dummies Questions & Answers Discuss UNIX and Linux user interfaces like GNOME, KDE, CDE, and Open Office here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem while storing sql query value in a variable krishna_gnv Shell Programming and Scripting 1 02-28-2008 07:37 AM
Problem storing SSH result in a variable prash184u Shell Programming and Scripting 1 01-17-2008 04:41 PM
Using 'defaults read' and storing the output in a variable davewg Shell Programming and Scripting 0 11-14-2007 08:04 AM
Storing the output into a variable ravi raj kumar UNIX for Dummies Questions & Answers 7 12-11-2006 09:14 AM
storing output of awk in variable mab_arif16 Shell Programming and Scripting 3 05-07-2006 06:15 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 12-12-2008
eswarreddya eswarreddya is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 5
Post problem while storing the output of awk to variable

Hi,

i have some files in one directory(say some sample dir) whose names will be like the following.
some_file1.txt
some_file2.txt.

i need to get the last modified file size based on file name pattern like some_

here i am able to get the value of the last modified file size using the following command:
echo `ls -lt /sample/some_* |awk '{print $5}'` | `awk '{ F = " " ; print $1 }'


but the problem is, i need to store this value in one variable, and needs to print that variable value.

i tried several ways like the following.

SIZE=`echo `ls -lt /sample/some_* |awk '{print $5}'` | `awk '{ F = " " ; print $1 }'`
echo $SIZE

but it is not successful.


Your immediate help will be greatly appreciated

Reagrds,
Eswar
 

Bookmarks

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:55 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