add aliases depending on exitcode

This commit is contained in:
Jakobus Schürz 2020-01-22 10:54:21 +01:00
parent c82b3b2eee
commit f8341cd4ad
3 changed files with 8 additions and 4 deletions

View file

@ -58,7 +58,8 @@ alias goxund='cd /home/jakob/xundeenergie.at/'
# system-dirs
alias gosystemd='cd /etc/systemd/system/'
alias goudevrules='cd /etc/udev/rules.d/'
alias gousrlocal='cd /usr/local/bin/'
alias gousrlocal='cd /usr/local/'
alias gousrlocalbin='cd /usr/local/bin/'
# btrfs-backup
alias golocbak='cd /var/cache/btrfs_pool_SYSTEM/'

View file

@ -98,10 +98,12 @@ fi
if [ $(id -u) -ne 0 ]; then
WDOTD=$(date "+${HOME}/archive/work/%Y/%m/work_%Y%m%d")
[ -e $WDOTD ] || mkdir -pv "${WDOTD}" >>${MYSHELLCONFIG_LOGFILE}
if [[ ( -e "${HOME}/WORK" && -h "${HOME}/WORK" ) || ! -e "${HOME}/WORK" ]] ; then
ln -svnf "${WDOTD}" "${HOME}/WORK" >>${MYSHELLCONFIG_LOGFILE}
if [[ ( -e "${HOME}/Work" && -h "${HOME}/Work" ) || ! -e "${HOME}/Work" ]] ; then
ln -svnf "${WDOTD}" "${HOME}/Work" >>${MYSHELLCONFIG_LOGFILE}
alias gowork='cd "${HOME}/Work"'
else
echo "${HOME}/WORK exists and is real directory" |tee -a ${MYSHELLCONFIG_LOGFILE} 2>&1
echo "${HOME}/Work exists and is real directory" |tee -a ${MYSHELLCONFIG_LOGFILE} 2>&1
alias gowork='echo "~/Work is not confiugurable, see ${MYSHELLCONFIG_LOGFILE}'
fi
fi

View file

@ -10,3 +10,4 @@ if [ -f ~/.aliases ]; then
. ~/.aliases
fi
WORK=~/Work