[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash scripting help
From: |
chitti |
Subject: |
Re: bash scripting help |
Date: |
Thu, 13 Sep 2007 11:02:06 -0700 (PDT) |
thank you very much
Stephane CHAZELAS-3 wrote:
>
> 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
>
>
>
>
--
View this message in context:
http://www.nabble.com/bash-scripting-help-tf4430729.html#a12660260
Sent from the Gnu - Bash mailing list archive at Nabble.com.