From ef52a18605b17a67eeed0a5772fb60d6d0106899 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Tue, 25 Aug 2015 13:43:50 +0200 Subject: Removed sudo function --- bash/.bashrc | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'bash') diff --git a/bash/.bashrc b/bash/.bashrc index c71c184..247955a 100755 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -67,34 +67,6 @@ is_alias() { fi } -# Execute functions and aliasses with sudo -if exists sudo; then - sudo() { - # Allow functions and aliasses to be executed with sudo - if is_function $1 2> /dev/null; then - tmpfile="/tmp/$(date +%s).sh" - - echo "#!$usr/bin/bash" > "$tmpfile" - echo "usr=$usr" >> "$tmpfile" - type $1 | grep -v "is a function" >> "$tmpfile" - echo "$@" >> "$tmpfile" - - chmod +x "$tmpfile" - - $usr/bin/sudo "$tmpfile" - - rm "$tmpfile" - elif is_alias $1 2> /dev/null; then - alias=$(type $1 2> /dev/null | - sed -n "s/^$1\ is\ aliased\ to\ \`\(.*\)'$/\1/p") - - $usr/bin/sudo "$alias" - else - $usr/bin/sudo "$@" - fi - } -fi - # Set autocomplete for sudo if exists complete && exists sudo; then complete -cf sudo -- cgit v1.2.3