Skip to content

Commit 695b46e

Browse files
committed
Fixed some aliases for BusyBox
1 parent 15902c6 commit 695b46e

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

rc/shell/aliases

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ function set_alias_completion_source() {
3434

3535
alias sudo='sudo ' # Enables the simultaneous use of sudo and other aliases
3636
alias lsmnt='lsblk -l | tail -n +2 | awk '\''length($7) { print $1" => "$7 }'\'''
37-
alias grep='grep -a --color --text'
38-
alias pcregrep='pcregrep -a --color --text'
39-
alias uptime='uptime -p && printf "since " && uptime -s'
37+
38+
if [ ! -f "/bin/busybox" ]; then
39+
alias grep='grep -a --color'
40+
alias pcregrep='pcregrep -a --color'
41+
else
42+
alias grep='grep -a --color --text'
43+
alias pcregrep='pcregrep -a --color --text'
44+
alias uptime='uptime -p && printf "since " && uptime -s'
45+
fi
4046

4147
# Directory navigation
4248
alias ..='cd ..'
@@ -58,10 +64,6 @@ if [ -n "${SSH_CLIENT}" ] || [ -n "${SSH_TTY}" ]; then
5864
IS_SSH=true
5965
fi
6066

61-
if [ ! -f "/bin/busybox" ]; then
62-
COREUTILS_VERSION=$(ls --version | head -n 1 | awk '{print $4}' | awk -F. '{print $1}')
63-
fi
64-
6567
${IS_SSH} && alias poweroff="echo Surely you don\'t mean to do that on the remote machine! && echo If you do, use \'command poweroff\' instead."
6668

6769
alias ls="ls -C --color=auto -h -Q --group-directories-first --format=horizontal"

0 commit comments

Comments
 (0)