On Sat, 2007-11-17 at 15:53 -0800, Randall R Schulz wrote:
> On Saturday 17 November 2007 15:41, Bryen wrote:
> > On Sat, 2007-11-17 at 15:30 -0800, Randall R Schulz wrote:
> > > ...
> >
> > > I've known users (dare I say, "lusers") to override rm with a
> > > script that moves the target files to a trashcan folder.
> >
> > Hmm... That would be an interesting project to try to create.  What a
> > way for me to flex my current knowledge and expand on it.  :-)
> 
> It's no big deal. Write an "rm" replacement script that moves files to a 
> specified trash folder rather than simply unlink them. The only thing 
> you really have to worry about is name clashes. When that happens, add 
> a suffix (making sure that the suffix is unique, of course). With a bit 
> more work, you could additionally mimic the file system hierarchy 
> within the trash folder, but that doesn't get you out of handling 
> multiple deletes of the same name (since files often get recreated 
> after they're deleted).
> 
So how would a script called rm not conflict with the real rm McCoy?
Nothing to you, but I'm just starting to get into scripting.  :-)  

Critique me here.  As I'm going by theory.  I would move the
current /bin/rm to a new location.  Then I would create an rm script and
place it in /bin where the current rm was located.  But within the rm
script, I would point to the rm command's full path when using rm's
functionality.

Thus users would never see the difference when they run /bin/rm, but the
script does the interpretation to /somewherelse/rm.

Did I figure it out right?  

-- 
---Bryen---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to