Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th October 2008, 05:04 PM
petervoldon Offline
Registered User
 
Join Date: Sep 2006
Posts: 21
Pattern Matching

Hi Guys!

First of all, thanks to all of you for helping me out with my previous requirements.. This one might be simple, but I cant find the best method to solve this. Anyway, here it is!

I have a file (which is actually the result of repquota -a) with fields as shown below:


User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 18512944 0 0 607802 0 0
bin -- 33168 0 0 354 0 0
daemon -- 432 0 0 44 0 0
mail -- 4 0 0 1 0 0
user -- 17536944 0 0 888888 0 0

(output truncated to save space and I know its messy when I Copy'n'Paste)

Here is what I need:

- Print the first field (User) and 6th field (Second User field) where 6th field (Second User field) is greater than 45000.

Currently, the output for my above example should be

root 999999
user 888888

(there should be more if there are other lines matching

Hope you guys can help me out with this..

Thanks a million in advance!!

Peter
Reply With Quote
  #2  
Old 16th October 2008, 05:14 PM
php1ic Offline
Registered User
 
Join Date: Oct 2008
Location: London - England
Posts: 137
AWK should do what you want, my version of fedora doesn't have repqota so I haven't tested but:

repquota -a | awk '($6>45000) {print $1" "$6}'
Reply With Quote
  #3  
Old 17th October 2008, 04:36 AM
petervoldon Offline
Registered User
 
Join Date: Sep 2006
Posts: 21
Quote:
Originally Posted by php1ic View Post
AWK should do what you want, my version of fedora doesn't have repqota so I haven't tested but:

repquota -a | awk '($6>45000) {print $1" "$6}'
Awesome!! Works Perfectly! Thanks a million friend!

Peter
Reply With Quote
  #4  
Old 17th October 2008, 10:19 AM
php1ic Offline
Registered User
 
Join Date: Oct 2008
Location: London - England
Posts: 137
No problem.
Reply With Quote
Reply

Tags
matching, pattern

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
perl pattern matching ibbo Programming & Packaging 0 30th April 2009 11:03 AM
target pattern contains no `%' (firefox) CopyrightPhilly Using Fedora 1 8th April 2008 07:17 AM
DVD player, criss-cross pattern tashirosgt Wibble 1 18th July 2007 07:06 PM
Matching the '\' pattern in PHP preg_replace() CD-RW Programming & Packaging 3 18th July 2007 12:01 AM


Current GMT-time: 06:35 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat