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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combine 2 bash commands into single line 2

Status
Not open for further replies.

rigstars2

Instructor
Dec 18, 2011
64
US
Hey guys,

Can you please help me solve this problem. These statements run fine on their own but I'd like to combine them into one. I can't seem to get it to work. Any guidance would be great.
Thanks!

# First statement
egrep -w 'Deny TCP|Deny UDP' $FW_LOG | awk '{print $1 " " $2 " " $3}' >> $OUTFILE

#Output
TCP 109.75.171.98:80 in
TCP 210.128.108.48:80 in

===================

# Second statement
echo 109.75.171.98 | geo
echo 210.128.108.48 | geo

#Output
Japan
United Kingdom

What I'd like to do is combine the 2 commands above so the output looks like this -

TCP 109.75.171.98:80 in Japan
TCP 210.128.108.48:80 in United Kingdom
 
florian,

everything works now.. thanks for your assistance. much appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top