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 # system-dirs
alias gosystemd='cd /etc/systemd/system/' alias gosystemd='cd /etc/systemd/system/'
alias goudevrules='cd /etc/udev/rules.d/' 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 # btrfs-backup
alias golocbak='cd /var/cache/btrfs_pool_SYSTEM/' alias golocbak='cd /var/cache/btrfs_pool_SYSTEM/'

View file

@ -98,10 +98,12 @@ fi
if [ $(id -u) -ne 0 ]; then if [ $(id -u) -ne 0 ]; then
WDOTD=$(date "+${HOME}/archive/work/%Y/%m/work_%Y%m%d") WDOTD=$(date "+${HOME}/archive/work/%Y/%m/work_%Y%m%d")
[ -e $WDOTD ] || mkdir -pv "${WDOTD}" >>${MYSHELLCONFIG_LOGFILE} [ -e $WDOTD ] || mkdir -pv "${WDOTD}" >>${MYSHELLCONFIG_LOGFILE}
if [[ ( -e "${HOME}/WORK" && -h "${HOME}/WORK" ) || ! -e "${HOME}/WORK" ]] ; then if [[ ( -e "${HOME}/Work" && -h "${HOME}/Work" ) || ! -e "${HOME}/Work" ]] ; then
ln -svnf "${WDOTD}" "${HOME}/WORK" >>${MYSHELLCONFIG_LOGFILE} ln -svnf "${WDOTD}" "${HOME}/Work" >>${MYSHELLCONFIG_LOGFILE}
alias gowork='cd "${HOME}/Work"'
else 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
fi fi

View file

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