Bash nono.

Mar. 13th, 2015 07:57 am
scottobear: (Default)
[personal profile] scottobear

`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.

Profile

scottobear: (Default)
scott von berg

April 2017

S M T W T F S
       1
2 345678
9 10 11 12 13 14 15
16 1718 19 20 21 22
23 2425 26 2728 29
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 14th, 2025 12:22 am
Powered by Dreamwidth Studios