LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-31-2010, 04:58 PM   #16
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600

What you should do is put rm back to where it was and forget using aliases or scripts like yours. Aliases can evaded, don't cover applications removing files and scripts can behave unexpectedly. besides replacing a system binary with a kludge isn't standards compliant anyway.

Re-inventing the wheel was done before, see: http://directory.fsf.org/project/trashcan/, http://sourceforge.net/projects/rmw/, http://code.google.com/p/safe-rm/, http://www.linuxquestions.org/questi...8/#post3564350.

Libtrash intercepts syscalls through LD_PRELOAD. From the README: "libtrash works with any GNU/Linux program, both at the console and under XFree86, and operates independently of the programming language the program was written in. The only exception are statically linked programs, which you probably won't find. It can be extensively configured by each user through a personal, user-specific configuration file." (Also see http://www.linuxquestions.org/questi...9/#post3453347.)

There also is ext3cow (but I don't know how it fares right now) and then there's versioning filesystems.
 
Old 06-01-2010, 05:11 AM   #17
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by unSpawn View Post
What you should do is put rm back to where it was and forget using aliases or scripts like yours.... besides replacing a system binary with a kludge isn't standards compliant anyway.
I completely agree on that part, but

Quote:
Originally Posted by unSpawn View Post
Aliases can evaded, don't cover applications removing files and scripts can behave unexpectedly.
I think that is one case in which something like this (not this, exactly, but something along similar lines) can make sense; if you are concerned about 'finger trouble' with a powerful command like 'rm -Rf' and variants thereof, then aliasing it to something that gives you a second chance can make sense (of course, you can also argue that someone who is not in control of what their fingers do shouldn't be in possession of a computer...not that I would make this argument, you understand).

If, of course, you replace a system binary, that changes things for all users; that seems sub-optimal.

Personally, I won't take any code seriously that is not in code tags or otherwise formatted for easy reading, because that means that the OP hasn't taken the effort to make it easy to read; why should hundreds of people have to make that effort because one didn't do it correctly? But, you'll have got exit codes wrong, everyone does.

So, when you try to update, uninstall or install software, expect the system not to perform the procedure correctly. In some cases, it will only be trivially different from a correct procedure, and the system will still work correctly. In others it won't.

Have Fun!
 
Old 06-08-2010, 02:23 PM   #18
jaikris
Member
 
Registered: Sep 2009
Posts: 31

Original Poster
Rep: Reputation: 15
am using " tar -cvf <destination > source > /dev/null " for the new command ( rm - emulation )

evan after am redirectig the output message , still am receiving the message : tar: Removing leading `/' from member names

how to avoid the message from screen
 
Old 06-22-2010, 04:44 AM   #19
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
Try 2&> /dev/null to redirect stderr as well. Bear in mind you're then sending stuff that might be important - tar telling you it's gone wrong - to the bit bucket.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] When I type "sudo grub" it says "command not found" in Ubuntu 9.10 Live CD. msbstar Linux - Newbie 10 04-01-2020 11:54 PM
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
Command "mail" returns "panic: temporary file seek" kenneho Linux - Software 5 12-23-2008 03:27 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Emulating "rm" with a script mike9287 Linux - Newbie 13 07-06-2006 09:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration