Results 1 to 3 of 3
What will this command do?
rm -fr $@;
Force remove recursively what?...
- 03-11-2008 #1
rm -fr $@;
What will this command do?
Force remove recursively what?rm -fr $@;
- 03-11-2008 #2
In most shells, $@ represents the set of all parameters. So, if you wrote a script consisting of a single line with your command and you called it with:
It would be equivalent to:Code:./myscript /home/AboveNBeyond /etc /usr/bin
Probably not a good idea. Of course, the command would only execute with the permissions it is run with so if you run that as normal user, AboveNBeyond, you would likely only delete your home directory as you don't have write permissions outside of ~.Code:rm -fr /home/AboveNBeyond /etc /usr/bin
Maybe one of the shell scripting gurus can explain it better.
- 03-11-2008 #3
AHH ok, point taken... I had it in my ~/.bashrc from some time back and could not remember why...
alias rmd= "rm -fr $@;"
So if I was in my home dir and hit rmd it would be a bad day. lol
Thanks.


Reply With Quote
