# shell and aliases



## gulanito (Sep 19, 2009)

Hi.
I created a script for have a "recycle bin".
The script simply moves a file to a specified folder.
I aliased the command "rm" to the command "trash" (the script) in the bash shell.
This hack works well under a terminal, but I'm using freebsd as a desktop, in particular, I'm using rox-filer as a file manager, so I want that when I delete a file under rox-filer, then, rox-filer runs the "trash" script, but it not works.
I suppose that rox uses a shell to do the commands (rm, mount, umount , and so on), so, when it runs "rm" then, because the alias, will run the "trash"script, but not works.
Rox should use a shell for do the commands?
How can I do?

Thanks


----------



## Alt (Sep 19, 2009)

It maybe use absolute paths like '/bin/mv' so aliases dont matter. You can try to rename /bin/mv and make symlink. Also its possible they use libc api, so /bin/mv file isnt used at all...


----------



## ale (Sep 19, 2009)

What make you thinking that it uses a script to delete files?


----------



## bigearsbilly (Sep 28, 2009)

as said, an alias won't work if you specify by name, or Rox is probly
using an exec(3)

yes well, i wouldn't mess about with /bin/rm personally, or any system files.
you could change the Rox-filer code I suppose.
or make a "send to" script.
(right click sendto->customize)

or be like the rest of us, delete and take responsibility for it!
personally I hate trash cans, they're an insidious habit.


----------



## SirDice (Sep 28, 2009)

bigearsbilly said:
			
		

> as said, an alias won't work if you specify by name, or Rox is probly using an exec(3)


My guess is it uses unlink(2) and/or rmdir(2).


----------

