From owner-freebsd-questions Sun May 13 10:29:25 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 007D937B424 for ; Sun, 13 May 2001 10:29:23 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 65843 invoked by uid 100); 13 May 2001 17:29:22 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15102.50290.164251.701392@guru.mired.org> Date: Sun, 13 May 2001 12:29:22 -0500 To: Andrew Hesford , Cc: questions@freebsd.org Subject: Re: COPY, CUT, PASTE (FILES) In-Reply-To: <111572649@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Andrew Hesford types: > Since this is an open UNIX, and UNIX was designed to be customized, why > don't you write such a utility and contribute it to the base (assuming > they will incorporate it)? Create a directory called /var/cache or > something, and then when you do `cache filename` it would move (or copy) > the file into /var/cache. Then a simple `drop-cache` would dump the > cached file into the current directory. > > Since the task is so simple, it wouldn't even need to take a fancy > utility; only a pair of shell scripts (or, if you are fancy, one shell > script and one symlink). Right - you could even have it store the file in /var/cache/username, so if you accidently cut something else before you paste that, you lose the old version. That would be a better mimic of the "cut" and "paste" behavior. Someone pretty much posted the solution I liked: a couple of shell functions, one that saved the absolute path of it's arguments in a shell variable: cut # Save full paths for stuff in FILE_CUT_BUFFER paste # aliased to "mv $FILE_CUT_BUFFER ." Doing this simple is pretty trivial. Dealing with oddities in stuff like absolute paths to start with, spaces in file names, and so on is a bit harder. Personally, I use the tab expansion mechanism to do the exploration: mv f/s... http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message