Bash nono.
Mar. 13th, 2015 07:57 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
`export EDITOR=$(which rm)`
$( )
is a bash-ism (Command Substitution ) which says, “Execute the command within the parenthesis, and replace the command with the output”.
In this case, it executes the which rm
command, that returns the full path to where the rm
utility is. Then it sets the EDITOR environment variable to that.
The end result is, when you call a utility which uses the EDITOR variable (visudo, vipw, etc), you delete the file you’re trying to edit.
Originally published at The Scotto Grotto. You can comment here or there.