shell and aliases

gulanito

Member


Messages: 39

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

Aspiring Daemon

Reaction score: 82
Messages: 726

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

Daemon

Reaction score: 166
Messages: 1,059

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

bigearsbilly

Active Member

Reaction score: 5
Messages: 143

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.
 
Top