[plug] zsh vs bash

Matt Kemner zombie at wasp.net.au
Mon Feb 12 19:16:31 WST 2001


On Mon, 12 Feb 2001, Christian wrote:

> Here's an idea for a cool shell feature... If you type an rm command by
> itself on the command line the shell delays execution of that command
> for 10 seconds although it takes you back to the shell prompt
> immediately.  Any time before the 10 seconds elapses you can cancel the
> unlinking.  This is probably scriptable I guess although not necessarily
> cleanly/robustly.  Anyone want to take a stab? :-)

function rm() {
	(sleep 10;/bin/rm $*) &
}

live:/tmp# touch blah
live:/tmp# rm -f blah
[1] 6724
live:/tmp# kill %1
live:/tmp# 
[1]+  Terminated              ( sleep 10; /bin/rm $* )
live:/tmp# ls blah
blah

Maybe? or Maybe not? :)

 - Matt




More information about the plug mailing list