about summary refs log tree commit diff stats
path: root/bash/please.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/please.bash')
-rw-r--r--bash/please.bash14
1 files changed, 0 insertions, 14 deletions
diff --git a/bash/please.bash b/bash/please.bash deleted file mode 100644 index 179ed17..0000000 --- a/bash/please.bash +++ /dev/null
@@ -1,14 +0,0 @@
1# PLEASE
2# if run without arguments, run the last command with 'sudo' (aka sudo !!)
3# if run WITH arguments, alias as sudo
4
5please() {
6 history -d -1
7 if [ -z "$1" ]; then
8 #set -- $(HISTTIMEFORMAT=$'\t' history 2 | sed 's/^.*\t//;q')
9 set -- $(fc -lnr | sed 1q)
10 fi
11 echo >&2 sudo "$@"
12 history -s sudo "$@"
13 "${DEBUG:-false}" || sudo "$@"
14}