From owner-freebsd-questions@FreeBSD.ORG Tue Jun 9 03:48:23 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E5F1106564A for ; Tue, 9 Jun 2009 03:48:22 +0000 (UTC) (envelope-from lordofhyphens@gmail.com) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.221.173]) by mx1.freebsd.org (Postfix) with ESMTP id 84ECB8FC08 for ; Tue, 9 Jun 2009 03:48:22 +0000 (UTC) (envelope-from lordofhyphens@gmail.com) Received: by qyk3 with SMTP id 3so4909670qyk.3 for ; Mon, 08 Jun 2009 20:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=P121srn+fgRpInsWJ7SNO/zM1fnw+6T1Dnym+pG4dMk=; b=v8mchzYQ9ePq+1dsLUn/8VxCsx4NokH1GsOL/ZFNtxRdKIwltusGx4p1B+f3KLc2Yp QjBhbNdStb43a2vC//u7vpM4wACgBpVC0G3WhObOfj99XU4mObBFt0D92bd9D+DGQy78 6JARwbll9OnaD5BN/MzhI+J91N/g7YNWcmlNc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=tjIusF7XY4YQM4+3xPHdX14rw08Bp3xO3jpamRHhL2w7H1KW6lMgYtZoT/kAug5wSf Tv1kadl8UvqA5F1Z/OHOLQXYxD05v1eIf/NfP6CfjTrrV0OepeVMtp6Rf7VT/orBeTEV Wqhj/Ee7QYadhvKJiEvrO2knxhVN9QcpRtKBE= MIME-Version: 1.0 Received: by 10.224.32.140 with SMTP id c12mr7571271qad.187.1244519301925; Mon, 08 Jun 2009 20:48:21 -0700 (PDT) In-Reply-To: References: Date: Mon, 8 Jun 2009 22:48:21 -0500 Message-ID: From: Lord Of Hyphens To: Daniel Underwood Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: Reproduce previous stdout output without running previous command 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, 09 Jun 2009 03:48:23 -0000 On Mon, Jun 8, 2009 at 10:44 PM, Daniel Underwood wrote: > OK, this is perhaps a weird question, capable of being very confusing. > So let's take a "for instance". > > Suppose I run something like the Linux command "fdupes" on a directory > with many large files. This operation will take considerable time to > complete. When it completes, a lot of output is send to stdout > (displayed on the terminal). > > Further suppose that after running the command, I decide I want to > save the output to a text file, so I can analyze the results outside > of the terminal. What can I do? Well, I can do a traditional > "copy-and-paste", or I could re-enter the previous command and send it > to a text file (which I ought to have done in the first place). > > But is there another option? Is there some variable (such as, > hypothetically, $output[n], where n=some integer index) that I could > use to store the results in a text file? Such an option might look > like the following: > > $ fdupes -r ~/directorywithlotsoflargefiles > > (.....lots of output, woops, should have sent to a text file!....) > > $ output[1] >> ~/textfile.txt > > Hopefully this has made (some) sense. > Check the manpage for tee. That should give you a solution you're looking for. --Joseph Lenox -- "Nothing unreal exists." - Kiri-kin-tha's First Law of Metaphysics.