From owner-freebsd-questions Thu Sep 19 16: 6:15 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60F3B37B401 for ; Thu, 19 Sep 2002 16:06:13 -0700 (PDT) Received: from blacklamb.mykitchentable.net (207-173-227-236.bras01.elk.ca.frontiernet.net [207.173.227.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80BCB43E3B for ; Thu, 19 Sep 2002 16:06:12 -0700 (PDT) (envelope-from drew@mykitchentable.net) Received: from TAGALONG (unknown [165.107.42.110]) by blacklamb.mykitchentable.net (Postfix) with SMTP id B6532EE741 for ; Thu, 19 Sep 2002 16:06:11 -0700 (PDT) Message-ID: <01c101c26031$257f5100$6e2a6ba5@TAGALONG> From: "Drew Tomlinson" To: "FreeBSD Questions" Subject: Is It Possible To Sort My Text File? Date: Thu, 19 Sep 2002 16:06:11 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'm running Postfix and have it configured to send 450 errors if the IP address of a mail server fails reverse lookup as described at http://www.muine.org/~hoang/postfix.html. As part of this config, I have a "override" file that is checked first. When I initially created the file, I sorted my entries based upon reported domain names. I have now decided that I would prefer to have the entries listed in IP address order. Although I could fix the file manually, I know there are tools in the OS that will do this for me and I'd like to learn how to use them. I am guessing that a command line using cat, sort, and sed or awk is what I need but I haven't been able to figure this out. Below is the first part of my file. Please look at the last entry I included because it has two IP addresses for the same domain comment and I would really like to keep entries like this intact. Any suggestions and examples for building the command will be appreciated. Thanks, Drew blacklamb# cat client_access # Add unknown client addresses that we'll accept mail from. See document at # http://www.muine.org/~hoang/postfix.html # temp allows 209.112.63.30 OK # 1st-N.com (Linksys Access Point) 209.185.202.19 OK # lenny.501mail.net 203.27.248.40 550 No UCE! # ABT Wish List -- wishlist.com (Electronics vendor) -- RCA HDTV 216.34.220.54 OK # Margaret Andrews - jefco.com 204.253.68.19 OK # alliance1.arschicago.com 207.224.40.14 550 No UCE! # askme.com 63.251.171.71 OK # bigfoot.com (Mark's Adding Machine) 206.97.247.12 OK # bluemountain.com (greeting cards) 63.210.57.38 OK # bodybuilding.com 63.146.198.70 OK # Broadway Computer 216.205.93.45 OK 65.115.35.240 OK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message