From 97b65f746d776f821c767ab27d9a4cf8eb401472 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Wed, 27 Jul 2022 09:47:19 -0600 Subject: [PATCH] cd to script --- heavy_script.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/heavy_script.sh b/heavy_script.sh index 27abd6f7..a4552ac3 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -1,5 +1,9 @@ #!/bin/bash +# cd to script +script=$(readlink -f "$0") +script_path=$(dirname "$script") +cd "$script_path" || exit # shellcheck source=functions/backup.sh source functions/backup.sh