undelete in FreeBSD?

Karel Miklav karel at inetis.com
Tue Jul 26 09:14:09 GMT 2005


Peter wrote:
> this tip is taken from BSD hacks

I do not believe this! This girl literally stole my script,
traveled back through time to cover the tracks and made an
article out of her shameless act :)

Anyway, here's the original version of 'the trash':

#! /bin/sh

# Move files in a trash folder.

trash_root=$HOME/.trash
trash_stamp=`date +%Y%m%d%H%M%S`
trash_dest=$trash_root/$trash_stamp

if [ ! -d $trash_root ]; then
   mkdir -p $trash_root
fi

if [ -e $trash_dest ]; then
   echo "Ups, $trash_dest exists!"
else
   mkdir $trash_dest
   mv $@ $trash_dest/
   echo "Files trashed."
fi

-- 

Regards,
Karel Miklav



More information about the freebsd-questions mailing list