From 59fb009c24b62e68553a2a9248ebebbcbcf1b593 Mon Sep 17 00:00:00 2001 From: Salman Abedin Date: Fri, 5 Jun 2020 00:34:06 +0600 Subject: [PATCH] Efficient scripting to figure out the directory path --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index 7b61395c..f28ffe11 100755 --- 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