<div class="gmail_quote">On Thu, Mar 15, 2012 at 05:43, Marco Tedaldi <span dir="ltr"><<a href="mailto:marco.tedaldi@gmail.com">marco.tedaldi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello don...<br>
<div class="im"><br>
<br>
</div>that's a really cool Idea...<br>
how about "brash" (Bash tRASH)?<br>
<br></blockquote><div>I like it!  Very *brash* of you!  :-p  <br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
A few Ideas:<br>
Implement a way to avoid collisions when two files have the same name<br>
(either check before moving and append some numeric to the filename if<br>
there is already a file with the same name or make up a new filename<br>
everytime, since you have the original filename in the logfile anyway).<br>
I'd suggest creating a new unique filename everytime (for example with<br>
the timestamp or use mktemp (which is used to make unique filenames for<br>
temporary files but could be used here as well i think).<br>
<br></blockquote><div>Good idea!  I started thinking about this last night as well, but have not had time to think much about the details yet.<br><br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

Use tar to put the file into the trash. that way, all the file<br>
properties (like owner, creation timestamp and permissions) can be<br>
restored as well. Sure, mv is WAY faster especially as long as the file<br>
is on the same filesystem as the trashcan-directory.<br>
<br></blockquote><div>That's a good point.  I want to add compression, and was thinking of using tar.  I don't really see the file attributes changing, as long as your trash can remains in $HOME.  But I would still like to use tar, or at least bzip or gzip to compress the trash can once it reaches a certain size.  Maybe I'll just compress it anyway.  But I do need to think about creating unique filenames if, somehow, a duplicate file is sent to the trash bin.<br>
<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Add a function to delete single files (or groups of files) from the<br>
trashcan.<br>
For example:<br>
trash purge [filename]<br>
<br>
Just a few of my crazy ideas...<br>
<br></blockquote><div>That's actually another interesting idea.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
And you really got me thinking about how to implement the handling of<br>
multiple files the easiest way. But as far as I can see you already did<br>
a great job in making functions out of everything, so including multiple<br>
file handling should not be a huge deal...<br>
<br></blockquote><div>Yes, I need to add error-checking, in case the user mis-types a filename to delete - things like that.  I also need to figure out the best way to handle multiple files - I'm thinking a for loop. <br>
</div><div><br>Should be quite fun. <br><br>Don<br></div></div>-- <br>D.C. Parris, FMP, ESL Certificate<br>Minister, Security/FM Coordinator, Free Software Advocate<div><a href="https://www.xing.com/profile/Don_Parris" target="_blank">https://www.xing.com/profile/Don_Parris</a>  |  <a href="http://www.linkedin.com/in/dcparris" target="_blank">http://www.linkedin.com/in/dcparris</a></div>
<div>GPG Key ID: F5E179BE</div><br>