3 ms·
That gives me an idea for my .bashrc: rm () { (sleep 30 && \rm "$@") & } (Untested, and I'm unlikely to use this.)
by Symbiote 8y ago
That gives me an idea for my .bashrc:
rm () {
(sleep 30 && \rm "$@") &
}
(Untested, and I'm unlikely to use this.)
- alanning 8y agoI’ve seen it generally recommended to use a different command rather than aliasing `rm`. Pretty sure there are a plethora of options for each OS but here’s a couple: For OSX, homebrew has a handy “trash” command line tool [1]. For Ubuntu, trash-cli seems popular [2]. 1. `brew install trash` 2. http://manpages.ubuntu.com/manpages/precise/man1/trash-put.1.html http://manpages.ubuntu.com/manpages/precise/man1/trash-put.1...
- llcoolv 8y agolol. good luck running a bash script that does a bunch of 'rm's.
- jeremyjh 8y agoHis aliases wouldn't be in scope there.
- llcoolv 8y agoThanks a lot! Here is a better explanation https://unix.stackexchange.com/questions/362546/what-is-the-scope-of-environment-variables-defined-in-bashrc https://unix.stackexchange.com/questions/362546/what-is-the-... . This seems like a decent gap in my knowledge. Is it still going to be out of scope if he e.g. runs the shell script from the shell?
- jeremyjh 8y agoNot if the alias is in .bashrc / .zshrc and they execute the shell script in the normal way. If they source the script, sure. But no one runs scripts that way, for this exact reason.