[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash scripting help
From: |
Stephane CHAZELAS |
Subject: |
Re: bash scripting help |
Date: |
Wed, 12 Sep 2007 18:49:34 GMT |
User-agent: |
slrn/0.9.8.1pl1 (Debian) |
2007-09-12, 10:00(-07), chitti:
>
> I need to seperate the UDP and TCP ports from the /etc/services files.
> any pointers or help on scripting this in bash would be helpful
> thanks
awk '
NF == 0 || $1 ~ /^#/ {next}
$2 ~ /\/tcp$/ {print > "services.tcp"; next}
$2 ~ /\/udp$/ {print > "services.udp"; next}
{print > "services.other"}' < /etc/services
--
Stéphane