Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 May 2001 12:29:22 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Andrew Hesford <ajh3@usrlib.org>, <ffkrz@iafrica.com>
Cc:        questions@freebsd.org
Subject:   Re: COPY, CUT, PASTE (FILES)
Message-ID:  <15102.50290.164251.701392@guru.mired.org>
In-Reply-To: <111572649@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Andrew Hesford <ajh3@usrlib.org> 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 <stuff>	# 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 <stuff> f<tab>/s<tab>...

	<mike
--
Mike Meyer <mwm@mired.org>			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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15102.50290.164251.701392>