From 7572627e85b52e1da5156b16432fcab64e7b4eb3 Mon Sep 17 00:00:00 2001 From: Salman Abedin Date: Fri, 5 Jun 2020 08:27:01 +0600 Subject: [PATCH] Efficient scripting to get the directory path (#686) Co-authored-by: Salman Abedin --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index 7b61395..f28ffe1 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