• 0 Posts
  • 4 Comments
Joined 5 months ago
cake
Cake day: June 27th, 2025

help-circle
  • DD Linux comes with a very special /etc/bashrc

    preexec () { dd "$@" }
    preexec_invoke_exec () {
        [ -n "$COMP_LINE" ] && return  # do nothing if completing
        [ "$BASH_COMMAND" = "$PROMPT_COMMAND" ] && return # don't cause a preexec for $PROMPT_COMMAND
        local this_command=`HISTTIMEFORMAT= history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//"`;
        preexec "$this_command"
    }
    trap 'preexec_invoke_exec' DEBUG
    

    This neat little wrapper will send any command you input to dd, then, if that returns with a 0 exit status, actually run your command in the prompt. I think Danny Devito would approve.