Minor performance improvements (#975)
* Skip head and grep and do it all in sed * Replace echo and awk with a parameter expansion
This commit is contained in:
parent
661c9f53db
commit
1df8bcd8fe
2 changed files with 2 additions and 2 deletions
|
@ -53,5 +53,5 @@ case "$ext" in
|
||||||
scad) openscad -o "$base".stl "$file" ;;
|
scad) openscad -o "$base".stl "$file" ;;
|
||||||
sent) setsid -f sent "$file" 2>/dev/null ;;
|
sent) setsid -f sent "$file" 2>/dev/null ;;
|
||||||
tex) textype "$file" ;;
|
tex) textype "$file" ;;
|
||||||
*) head -n1 "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
|
*) sed -n '/^#!/s/^#!//p; q' "$file" | xargs -r -I % "$file" ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -7,7 +7,7 @@ queuefile="${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue"
|
||||||
|
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
[ -z "$line" ] && continue
|
[ -z "$line" ] && continue
|
||||||
url="$(echo "$line" | awk '{print $1}')"
|
url="${line%%[ ]*}"
|
||||||
qndl "$url" "curl -LO"
|
qndl "$url" "curl -LO"
|
||||||
done < "$queuefile"
|
done < "$queuefile"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue