diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-03-29 17:17:40 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-03-29 17:17:40 +1300 |
commit | 607527f2d20e40dea83a1fc6ead4ad37467c0f4c (patch) | |
tree | 443542331aa694ebd4bdbdfb80c96d3b8260a2da /ksh | |
parent | Remove unneeded leading pipe from b:undo_ftplugin (diff) | |
download | dotfiles-607527f2d20e40dea83a1fc6ead4ad37467c0f4c.tar.gz dotfiles-607527f2d20e40dea83a1fc6ead4ad37467c0f4c.zip |
Fix up a few cosmetic shell anti-patterns
Diffstat (limited to 'ksh')
-rw-r--r-- | ksh/kshrc | 3 | ||||
-rw-r--r-- | ksh/kshrc.d/prompt.ksh | 7 |
2 files changed, 6 insertions, 4 deletions
@@ -21,6 +21,7 @@ HISTFILE=$HOME/.ksh_history # Load any supplementary scripts for ksh in "$HOME"/.kshrc.d/*.ksh ; do - [[ -e $ksh ]] && . "$ksh" + [[ -e $ksh ]] || continue + . "$ksh" done unset -v ksh diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh index 99e6238d..64e22e8e 100644 --- a/ksh/kshrc.d/prompt.ksh +++ b/ksh/kshrc.d/prompt.ksh @@ -14,7 +14,7 @@ function prompt { on) # Basic prompt shape depends on whether we're in SSH or not PS1= - if [[ -n $SSH_CLIENT ]] || [[ -n $SSH_CONNECTION ]] ; then + if [[ -n $SSH_CLIENT || -n $SSH_CONNECTION ]] ; then PS1=$PS1'${HOSTNAME%%.*}:' fi @@ -176,8 +176,9 @@ function prompt { fi # There are some untracked and unignored files - if git ls-files --directory --error-unmatch --exclude-standard \ - --no-empty-directory --others -- ':/*' ; then + if git ls-files --directory --error-unmatch \ + --exclude-standard --no-empty-directory \ + --others -- ':/*' ; then state=${state}'?' fi |