Add existing scripts
This commit is contained in:
1 parent
2ab5a42c2b
commit
3c05d74104
31 files changed
+1138
No files matched your search
@@ -0,0 +1,19 @@
|
||||
# Show the top "n" values of a set (first number is the "n" to get)
|
||||
show_top() {
|
||||
local n=$1
|
||||
local values=${@:2:n}
|
||||
echo "Top ${n} values: ${values}"
|
||||
}
|
||||
|
||||
|
||||
# This version uses shift to get the same result
|
||||
show_top2 () {
|
||||
# Grab the number of values to show, then shift.
|
||||
local n=$1
|
||||
shift
|
||||
|
||||
# Get the set of vaules to show
|
||||
local values=${@:1:n}
|
||||
echo "Top ${n} values: ${values}"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user