summaryrefslogtreecommitdiffstats
path: root/.local/bin/compiler
diff options
context:
space:
mode:
authorThomas Voss <57815710+Mango0x45@users.noreply.github.com>2021-07-21 18:09:53 +0200
committerGitHub <noreply@github.com>2021-07-21 12:09:53 -0400
commit1df8bcd8feffde0361726c5b70d5deb0bc183f60 (patch)
tree2973d4c2b3b4ff548b0b5215a1bbf7db938c8726 /.local/bin/compiler
parent661c9f53dba1a2c2241fd3c4c3554ec1ae380b51 (diff)
downloadeibhear-1df8bcd8feffde0361726c5b70d5deb0bc183f60.tar.gz
eibhear-1df8bcd8feffde0361726c5b70d5deb0bc183f60.tar.zst
eibhear-1df8bcd8feffde0361726c5b70d5deb0bc183f60.zip
Minor performance improvements (#975)
* Skip head and grep and do it all in sed * Replace echo and awk with a parameter expansion
Diffstat (limited to '.local/bin/compiler')
-rwxr-xr-x.local/bin/compiler2
1 files changed, 1 insertions, 1 deletions
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