Convert alias commands to functions.

This commit is contained in:
Scott Wallace 2016-07-16 16:46:14 +01:00
parent 4947444982
commit 784826ff43

19
.bashrc
View file

@ -40,7 +40,7 @@ getkey() {
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# The best editor # The best editor
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
[[ -x $(which vim 2>/dev/null) ]] && alias vi=vim [[ -x $(which vim 2>/dev/null) ]] && vi() { vim ${@}; } && export -f vi
export EDITOR=vi export EDITOR=vi
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
@ -119,16 +119,15 @@ export PROMPT_COMMAND="history -a; ${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}"
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
# Command aliases # Command alias functions
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
alias ll='ls -l' ll() { ls -l ${@}; } && export -f ll
[[ -x $(which htop 2>/dev/null) ]] && alias top='sudo htop' datafart() { curl --data-binary @- datafart.com; } && export -f datafart
[[ -x $(which psgrep 2>/dev/null) ]] || alias psgrep='ps -ef | grep' space() { du -ahx --max-depth=1 | sort -h; } && export -f space
alias datafart='curl --data-binary @- datafart.com' [[ -x $(which htop 2>/dev/null) ]] && top() { sudo htop; } && export -f top
[[ -x $(which gdu 2>/dev/null) ]] && alias du='gdu' [[ -x $(which psgrep 2>/dev/null) ]] || ( psgrep() { ps -ef | grep ${@}; } && export -f psgrep )
[[ -x $(which gsort 2>/dev/null) ]] && alias sort='gsort' [[ -x $(which gdu 2>/dev/null) ]] && du() { gdu ${@}; } && export -f du
[[ -x $(which gsort 2>/dev/null) ]] && sort() { gsort ${@}; } && export -f sort
alias space='du -ahx --max-depth=1 | sort -h'
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------
#-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------