commit 7572627e85b52e1da5156b16432fcab64e7b4eb3
parent 32e0623424c5b7de4c83523d87302ce1de12a1c6
Author: Salman Abedin <salman104alvi@gmail.com>
Date: Fri, 5 Jun 2020 08:27:01 +0600
Efficient scripting to get the directory path (#686)
Co-authored-by: Salman Abedin <salmanabedin@zohomail.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.local/bin/compiler b/.local/bin/compiler
@@ -10,7 +10,7 @@
# string "xelatex" somewhere in a comment/command in the first 5 lines.
file=$(readlink -f "$1")
-dir=$(dirname "$file")
+dir=${file%/*}
base="${file%.*}"
cd "$dir" || exit