stuff
This commit is contained in:
@@ -305,3 +305,27 @@ svl_confirm_or_die() {
|
||||
svl_die "exiting"
|
||||
fi
|
||||
}
|
||||
|
||||
# svl_count #=> 0
|
||||
# svl_count a b c #=> 3
|
||||
# prints the number of arguments on stdout.
|
||||
svl_count() {
|
||||
echo $#
|
||||
return 0
|
||||
}
|
||||
|
||||
svl_count_matches() {
|
||||
svl_exact_args $# 1
|
||||
declare nullglob_before
|
||||
if shopt -q nullglob; then
|
||||
nullglob_before=enabled
|
||||
else
|
||||
nullglob_before=disabled
|
||||
fi
|
||||
shopt -s nullglob
|
||||
svl_count $1
|
||||
if [[ "$nullglob_before" == "disabled" ]]; then
|
||||
shopt -u nullglob
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user