git.annexia.org
/
goals.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c174a4f
)
stdlib: Implement sort function.
author
Richard W.M. Jones
<rjones@redhat.com>
Sat, 4 Jan 2020 11:56:00 +0000
(11:56 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Sat, 4 Jan 2020 11:56:00 +0000
(11:56 +0000)
stdlib/prelude.gl
patch
|
blob
|
history
diff --git
a/stdlib/prelude.gl
b/stdlib/prelude.gl
index
15b1c0b
..
7e6cbd5
100644
(file)
--- a/
stdlib/prelude.gl
+++ b/
stdlib/prelude.gl
@@
-37,6
+37,17
@@
tactic *exists (filename) = {
test -f %filename || exit 99
}
+#----------------------------------------------------------------------
+# Text functions.
+
+# Sort + uniq a list.
+function sort (xs) = {
+ for f in %xs; do echo "$f"; done | sort -u
+}
+
+#----------------------------------------------------------------------
+# File functions.
+
# Expand a wildcard into a list of filenames.
function wildcard (wc) = {
shopt -s nullglob