From a93d14d328536f413233bd62f6deff0e1748142e Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Wed, 21 Jul 2021 17:16:18 +0200 Subject: [PATCH] Skip head and grep and do it all in sed --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/compiler b/.local/bin/compiler index 39e149ed..faf37c9e 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