Project

General

Profile

« Previous | Next » 

Revision 14842

lib/sh/util.sh: added become_sudo alias

View differences:

trunk/lib/sh/util.sh
495 495
}
496 496
alias sudo='"sudo" ' # last space alias-expands next word
497 497

  
498
# usage: func() { become_sudo; __; }
499
alias self_sudo='sudo "${FUNCNAME%%__*}" "$@"'
500
alias become_sudo='if ! test "$is_root"; then self_sudo; fi'
498 501

  
502

  
499 503
#### exceptions
500 504

  
501 505
fi # load new aliases

Also available in: Unified diff