Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tail & Egrep command help 1

Status
Not open for further replies.

Tranbo

IS-IT--Management
Apr 14, 2010
75
0
0
US
tail -f /var/spool/lp/logs/requests |egrep "U|D|F"

This is the Output:

= APHP-662741, uid 394, gid 50, size 64134, Fri Sep 21 09:47:02 2012
D APHP
F /usr/spool/lp/temp/662741-1
U karoline


How do you format the Output to look like this;

karoline APHP /usr/spool/lp/temp/662741-1


Thanks in advance for your help

 
A starting point:
yourCommand | awk '$1=="D"{d=$2}$1=="F"{f=$2}$1=="U"{print $2,d,f}'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top