Raj KAJ (scottobear) wrote,
Raj KAJ
scottobear

Bash nono.

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

Tags: uncategorized
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments