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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to read and write a random row from a file? sashankkrk UNIX for Dummies Questions & Answers 9 05-13-2008 04:26 AM
How to read and write directory or file contents in c++ ? namrata5 High Level Programming 3 09-28-2007 12:58 PM
sed to read and write to very same file 435 Gavea Shell Programming and Scripting 5 06-29-2006 08:04 PM
popening for read and write szzz High Level Programming 1 11-18-2003 08:05 AM
read, write & STDOUT_FILENO.... M3xican High Level Programming 2 07-17-2002 01:41 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-10-2008
Registered User
 

Join Date: May 2007
Posts: 54
Stumble this Post!
read and write from a file

I have tried to show the file name whose size is greater than 200 byte in current directory.
Please help me.

ls -l | tr -s " " " " | cut -f 5,9 -d " " >out.txt

#set -a x `cat out.txt`
i=0
`cat out.txt` | while [ $i -le 5 ]
do
read x
echo $x
#re=200
j=0
if [ "${x[$j]}" < "200" ]
then
echo $j
j=`expr $j + 1`
echo ${x[$j]}
fi
i=`expr $i + 1`
done
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-10-2008
Moderator
 

Join Date: Feb 2007
Posts: 1,953
Stumble this Post!
Try the find command with the option -size.

Regards
Reply With Quote
  #3 (permalink)  
Old 01-10-2008
Registered User
 

Join Date: Jun 2007
Posts: 377
Stumble this Post!
awk

Hi,

Is follow one ok for you,pls try.

Code:
ls -l | awk '$5>200'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0