Advertisement

04.10.2007 at 06:04PM PDT, ID: 22503336
[x]
Attachment Details

How to search the key word and display the line with the key word and the following line

Asked by wesly_chen in Linux, Linux Programming, Linux Administration

Tags: 17179869180, line, word

In Red Hat Linux, the output of "quota -v" looks like:
------------
Disk quotas for user user1 (uid 1001):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
filer1:/vol/fvol1/tools/pkgs/Linux_i686/4_2005/usr/local
                99829908  17179869180 17179869180          345334  4294967295 4294967295
filer1:/vol/fvol1/apps
                99829908  17179869180 17179869180          345334  4294967295 4294967295
filer1:/vol/fvol1/users/user2
                 370988  512000  512000            2767  4294967295 4294967295
filer1:/vol/fvol1/users/user1
                 370988  512000  512000            2767  4294967295 4294967295       <=== this is a separate line
------------------

I would like to parse this output to the following format:
------------
Disk quotas for user user1 (uid 1001):
UserName  blocks(kB)   quota(kB)   limit(kB)
user1       370988  512000  512000
------------

Could someone help me?

Thanks in advance.
Start Free Trial
 
Keywords: How to search the key word and displ…
 
Loading Advertisement...
 
[+][-]04.10.2007 at 06:23PM PDT, ID: 18886821

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 06:53PM PDT, ID: 18886960

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 07:06PM PDT, ID: 18887012

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 07:10PM PDT, ID: 18887029

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 07:59PM PDT, ID: 18887188

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 08:15PM PDT, ID: 18887233

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 08:29PM PDT, ID: 18887274

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 08:35PM PDT, ID: 18887288

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 10:31PM PDT, ID: 18887593

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.10.2007 at 10:41PM PDT, ID: 18887616

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.11.2007 at 10:31AM PDT, ID: 18891550

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 10:40AM PDT, ID: 18891636

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 05:22PM PDT, ID: 18894846

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 06:22PM PDT, ID: 18895052

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2007 at 06:29PM PDT, ID: 18895070

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.18.2007 at 07:57PM PDT, ID: 18936581

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Linux, Linux Programming, Linux Administration
Tags: 17179869180, line, word
Sign Up Now!
Solution Provided By: Nopius
Participating Experts: 4
Solution Grade: A
 
 
[+][-]04.26.2007 at 02:57PM PDT, ID: 18985455

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32