Compare commits

2 Commits

Author SHA1 Message Date
0d1b271dba sync.sh: Test if nothing to do 2023-12-10 19:24:19 +01:00
5b01e92806 bashrc: add rehash() 2023-12-10 19:23:40 +01:00
2 changed files with 13 additions and 2 deletions

View File

@@ -498,6 +498,9 @@ parse_opts() {
[[ -f "$_backup_dir/.syncrc" ]] && _config=${_config:-"$_backup_dir/.syncrc"}
fi
# We do not know what to do...
[[ -z "$_config" ]] && usage
# see https://unix.stackexchange.com/questions/406216
CONFIG=$(realpath -sm "$_config")
if [[ -z "$CONFIG" ]]; then
@@ -507,7 +510,7 @@ parse_opts() {
printf "%s: Cannot open %s file\n" "$CMDNAME" "$CONFIG"
exit 9
fi
# shellcheck source=sync-conf-example.sh
# shellcheck source=share/sync/sync-conf-example.sh
source "$CONFIG"
# _backup_dir takes precedence on SOURCEDIR (useless ?)

View File

@@ -178,7 +178,15 @@ export USERTMP=~/tmp
alias fuck='sudo $(history -p \!\!)'
# I am used to rehash...
alias rehash="hash -r"
# rehash - manage bash's remembered commands paths
# $1...: Only forget those commands
rehash() {
if (($#)); then
hash -d "$@"
else
hash -r
fi
}
# french-> english and english->french translation
alias trans="trans.sh"