Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Woulr rm -i help too?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Woulr rm -i help too?
Authored by: dombi on May 18, '04 11:37:21AM

If someone set in their .profile an alias for rm

alias rm='rm -i'

woudl that work against the "Trojan"? Basically this way every time you use the rm command, the Terminal would ask you if you are sure that you would like to delete the files.



[ Reply to This | # ]
Woulr rm -i help too?
Authored by: tang on May 18, '04 11:52:30AM

It depends on how the trojan was written. For instance, the writer could just refer to the full path of the rm command. /bin/rm (or wherever it is by default) and the alias would not work. Also, what is to stop the trojan from just aliasing rm back to rm before they execute? or if the trojan even loads your .bash_profile or not...



[ Reply to This | # ]
Woulr rm -i help too?
Authored by: lagroue on May 18, '04 11:55:15AM

Hmmm, no.
The -f option has precedence over the -i :

$ touch toto
$ rm toto
remove toto? n
$ rm -f toto
$



[ Reply to This | # ]
Woulr rm -i help too?
Authored by: semios on May 19, '04 04:58:56PM

No. Aliases do not apply to non-interactive scripts in bash.



[ Reply to This | # ]