From 1df8bcd8feffde0361726c5b70d5deb0bc183f60 Mon Sep 17 00:00:00 2001 From: Thomas Voss <57815710+Mango0x45@users.noreply.github.com> Date: Wed, 21 Jul 2021 18:09:53 +0200 Subject: Minor performance improvements (#975) * Skip head and grep and do it all in sed * Replace echo and awk with a parameter expansion --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.local/bin/compiler') diff --git a/.local/bin/compiler b/.local/bin/compiler index 39e149e..faf37c9 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -53,5 +53,5 @@ case "$ext" in scad) openscad -o "$base".stl "$file" ;; sent) setsid -f sent "$file" 2>/dev/null ;; tex) textype "$file" ;; - *) head -n1 "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; + *) sed -n '/^#!/s/^#!//p; q' "$file" | xargs -r -I % "$file" ;; esac -- cgit v1.3.1