TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:2361] script problems



On Thu, 26 Nov 1998, Ben Luey wrote:

> If I run deltest on the directory john it works, but if I run deltest
> again on another directory called john (while /home/delete/username/john/
> exists) I get an error message that is can't overwrite the directory.
> 
> Any ideas? I'd like to get the script to the point where I can rename it
> to rm and rm to something else and know that it'll always work right.

Hmm...  No suggestions on your first problem with the quotes.  Sorry.  I'm
not much of a shell programmer yet. :)  As far as duplicate directory
names, I'd definitely do the rename thing: add a '.<num>' to the end of
the directory name as you move it where <num> is the count of
files/directories with the same name.  You could leave the first
unchanged, the second w/".0", etc... 

As far as replacing '/bin/rm': your machine, your perogative.  I'd
probably rename '/bin/rm' to '/bin/rm-old' and symlink your new script
as '/bin/rm'.

Another suggestion.  You may consider moving your deleted directory under
/tmp instead of /home.  I have a hunch that this would follow Linux system
policy a little closer -- I'm new to this, too, so I'm probably wrong :).

Chewie