Skip to content

Commit

Permalink
Change to bashism [[
Browse files Browse the repository at this point in the history
  • Loading branch information
markc committed May 31, 2023
1 parent bd860aa commit 158855e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions _shrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[[ $DEBUG ]] && set -x

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/snap/bin:~/.sh/bin
SUDO=$([ $(id -u) -gt 0 ] && echo 'sudo ')
SUDO=$([[ $(id -u) -gt 0 ]] && echo 'sudo ')
EDITOR=nano
COLOR=31
LABEL=$(hostname)
Expand All @@ -14,16 +14,16 @@ LABEL=$(hostname)
[[ -f /etc/os-release ]] && OSTYP=$(awk -F= '/^ID=/ {print $2}' /etc/os-release|sed 's/"//g')

# Import global aliases
[ -f ~/.sh/lib/aliases ] && . ~/.sh/lib/aliases
[[ -f ~/.sh/lib/aliases ]] && . ~/.sh/lib/aliases

# Local custom aliases and env var overrides
[ -f ~/.myrc ] && . ~/.myrc
[[ -f ~/.myrc ]] && . ~/.myrc

# Import managed env vars
[ -f ~/.sh/lib/functions ] && . ~/.sh/lib/functions
[[ -f ~/.sh/lib/functions ]] && . ~/.sh/lib/functions

_HOST=$(hostname -f | tr 'A-Z' 'a-z')
if [ -f ~/.vhosts/$_HOST ]; then
if [[ -f ~/.vhosts/$_HOST ]]; then
. ~/.vhosts/$_HOST
else
sethost
Expand Down

0 comments on commit 158855e

Please sign in to comment.