Skip to content

Commit

Permalink
Replace tail -r with a portable shell function
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Dec 14, 2023
1 parent 6450768 commit b8415c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inst/bin/pkg-config
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ PKG_CONFIG_LIBS=$("$EM_PKG_CONFIG" --static "$@")
#
# Remove duplicates in `pkg-config` output, maintaining the original order,
# and working from right to left.
echo "$PKG_CONFIG_LIBS" | xargs -n1 | tail -r | awk '!x[$0]++' | tail -r | xargs
tac() { awk '{ buf[NR]=$0 } END { for (i=NR; i>=1; i--) print buf[i] }'; }
echo "$PKG_CONFIG_LIBS" | xargs -n1 | tac | awk '!x[$0]++' | tac | xargs

0 comments on commit b8415c1

Please sign in to comment.