chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
9039024
)
dot/bashrc: Fix `rootly' to make a shell on demand.
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 4 Jun 2011 13:15:22 +0000
(14:15 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 4 Jun 2011 13:21:48 +0000
(14:21 +0100)
Annoyingly, `sudo' doesn't start a shell if you don't give it a command
to run. So turn `rootly' into a shell function which does the right
thing for me.
dot/bashrc
patch
|
blob
|
blame
|
history
diff --git
a/dot/bashrc
b/dot/bashrc
index c39392ababdea585117cc3e78637141aca732b1a..69af4a1d07af68a5d928cf69c577e3b2fd01706f 100644
(file)
--- a/
dot/bashrc
+++ b/
dot/bashrc
@@
-98,7
+98,10
@@
alias cx='chmod a+x'
alias which="command -v"
alias rc="rc -l"
alias ssync="rsync -e ssh"
-alias rootly=$__MDW_ROOTLY
+rootly () {
+ case $# in 0) set -- "${SHELL-/bin/sh}" ;; esac
+ $__MDW_ROOTLY "$@"
+}
alias r=rootly
alias re="rootly $EDITOR"
alias pstree="pstree -hl"