The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
checking directory size in the text file G.K.K Shell Programming and Scripting 5 09-25-2008 11:23 AM
Compare date of file and directory odd_r Shell Programming and Scripting 2 08-26-2008 10:39 AM
How to know size of file in a directory kittusri9 Shell Programming and Scripting 1 04-28-2008 09:43 AM
compare file size from a output file from a script moustik Shell Programming and Scripting 7 11-07-2007 10:17 AM
How to compare file size after ftp? icemania Shell Programming and Scripting 1 07-10-2007 12:17 AM

Closed Thread
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
  #1 (permalink)  
Old 01-08-2009
Aditya.Gurgaon Aditya.Gurgaon is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 29
How to compare size of two file which is in one directory

I have two file in a Directory.I want a script which will compare the Size of Two file.
Can Anyone Help me on this:


linasplg11:/opt/dataout/kk/linasplg11 # cat size

-rwxrwxrwx 1 root root 16658 Jan 8 13:58 lina_IP_SIP_1231325621210.xml

-rwxr-xr-x 1 root root 16672 Jan 8 14:30 lina_IP_SIP_1231326111273.xml
  #2 (permalink)  
Old 01-08-2009
indianjassi indianjassi is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 24
counter=0
cat size | while read a
do
if [ counter="1" ]
then
cmp2=`echo $a | awk -F " " '{print $5}'`
fi
else
cmp1=`echo $a | awk -F " " '{print $5}'`
elif
counter=`expr{counter+1}`
done

if (cmp1 > cmp2)
{your code|
else
{
your code
}
fi


bye bye
Closed Thread

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 02:49 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