From owner-freebsd-questions@FreeBSD.ORG Tue Nov 8 17:47:05 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 B98EA16A421 for ; Tue, 8 Nov 2005 17:47:05 +0000 (GMT) (envelope-from jellis@dhnet.us) Received: from smtp1.linkline.com (smtp1.linkline.com [66.59.235.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0110143D66 for ; Tue, 8 Nov 2005 17:47:03 +0000 (GMT) (envelope-from jellis@dhnet.us) Received: from [64.30.211.58] (64-30-211-58.dsl.linkline.com [64.30.211.58]) by smtp1.linkline.com (Postfix) with ESMTP id 9A67A9CF0C; Tue, 8 Nov 2005 09:47:00 -0800 (PST) User-Agent: Microsoft-Entourage/11.2.0.050811 Date: Tue, 08 Nov 2005 09:47:00 -0800 From: Jeffrey Ellis To: David Fleck , FreeBSD questions Message-ID: Thread-Topic: How to sort find results Thread-Index: AcXkjGt/qcRqOlB/EdqYJgAKlXMBfA== In-Reply-To: <20051108065038.R3084@grond.sourballs.org> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Cc: Subject: Re: How to sort find results X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2005 17:47:05 -0000 Hi, David-- That did it! Thank you :) So, now when I run it I get the following output: # ./date_sort /desktop Sep 13 11:10:34 2005 /desktop/.localized Nov 8 09:12:40 2005 /desktop/date_sort But there are actually 76 items on my desktop. Is it possible I'm not specifying an option correctly? Thanks again :) All My Best, Jeffrey on 11/8/05 5:31 AM, David Fleck at david.fleck@mchsi.com wrote: > On Mon, 7 Nov 2005, Jeffrey Ellis wrote: >> It's on my Desktop. Should it be in particular location? (Don't say it... >> Something obvious, right ;) > > It doesn't have to be anywhere in particular, as long as you can find it > when you want to run it. When you typed > >>> #head date_sort >>> head: date_sort: No such file or directory > > I assume that the date_sort script wasn't in the directory you were > running the 'head' command from. In this case, you'd have to run it as > > #head /full/path/to/date_sort > > otherwise 'head' won't be able to find date_sort. > >> I actually did see his email. I've checked the copy/paste of the script, and >> it looks like all carriage returns. I don't know how to type line feeds... >> Is that what they should be? > > The problem is that Windows and UNIX have different concepts of how to end > lines. Windows (and some mail programs, and possibly some web servers - > I'm just guessing here) think each line of a text-mode should end with a > carriage return (CR) followed by a line feed (LF). UNIX doesn't > distinguish between text-mode and binary-mode files, and thinks a line > should end with just an LF, and the CR is retained as extra junk at the > end of the line. > > The easiest way that I know of to check for and handle this problem (which > may not be the easiest way to handle it, but it's the one I'm familiar > with) is to use the 'vi' editor. I don't know if you're familiar with > 'vi'; it can be a little confusing to the uninitiated. The following > should step you through it -- make a backup of the date_sort file first. > > 1. cd to the directory containing date_sort. > > 2. Open the file in vi: > #vi date_sort > > 3. Type the following, where [Ctrl] means the Ctrl key, and [Enter] means > the Enter key: > > :%s/[Ctrl]V[Enter]//[Enter] > > 4. Save the result: > :wq[Enter] > > Now, hopefully, the CR-LF's have all been converted to LF's. Try running > the script again (personally, I'd test it on a smaller directory structure > than /, just to see if it works -- running it on / will probably take a > long while). > > The output of 'head /path/to/date_sort' may still be useful, btw. > > -- > David Fleck > david.fleck@mchsi.com >