To view parent comment, click here.
To read all comments associated with this story, please click here.
ok I'll give an example
let's say you want to delete all files with extension .txt and you type this
rm * .txt
oops forgot I added a space
oops thanks for not telling me I will wipe out all the files and just do it anyway.
Powershell requires confirmation
If you're that careless then turn interactive mode on. Problem solved.
ok I'll give an example of unintuitiveness.
let's say you want to delete all files with extension .txt and you type this
rm * .txt
oops forgot I added a space
oops thanks for not telling me I will wipe out all the files and just do it anyway.
Powershell requires confirmation
well... just add
alias rm 'rm -i'
to your .login file or .cshrc (depending on your shell)
problem solved - confirmation for every deletion
I think it's a REALLY BAD idea to alias rm to "rm -i". Not because I'm implacably opposed to interactive deletion (i'm not) but because (a) it might screw up scripts which rely on rm NOT being interactive to work properly; and (b) what happens when you move to the machine of someone who has NOT aliased rm to "rm -i"?
Far better to alias "rmi"to "rm -i" "mvi"to "mv -i" etc, and use those instead. Then when you use a system that uses the default behaviour for "rm" and doesn't have those aliases, it'll say "rmi... not found."
Bash is not unintuitive. It is powerful and demands that you respect that power. For example, you could easily implement a "Trash" mechanism in Bash so if you did type that command, your files would be easily retrievable.
I HATE the idea of a shell asking me if I'm sure every time I type a command.
I did something similar some time ago, but it was a chown -R in the /etc directory...
It was solely my fault and I'm only blaming myself because I didn't double-check what I was typing and where.
And, btw, with confirmations for every single deletion, sooner or later you'll switch to the "hit enter without reading" side, and the advantages of the confirmations are gone.







Member since:
2007-01-22
ok I'll give an example of unintuitiveness.
let's say you want to delete all files with extension .txt and you type this
rm * .txt
oops forgot I added a space
oops thanks for not telling me I will wipe out all the files and just do it anyway.
Powershell requires confirmation
Edited 2007-01-25 05:12