Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
case ${.sh.version} in
*93[[:alpha:]]+*) :;; #this appears to be ksh93, we're OK
*) echo "version appears to be too old"
exit # otherwise, bail out
;;
esac
if [[ -z ${bloop+bloop has a value} ]]; then
print "no bloop variable"
elsif (( abs(1) )); then
print -- $(( abs(bloop) ))
fi
typeset -a int_vars
set | while IFS='=' read -r var value; do
if [[ $value == +([[:digit:]]) ]]; then
int_vars[n++]=$var
let sum += $value
fi
done
print "${int_vars[*]}"
print -- $sum

View file

@ -0,0 +1,26 @@
if [[ $BASH_VERSION < "4.2" ]]; then
echo "version is too old"
exit
fi
if [[ ! -v bloop ]]; then
echo "no bloop variable"
elif [[ $(type -t abs 2>/dev/null) != function ]]; then
echo "abs is not a shell function"
else
echo $(abs $bloop)
fi
# need to populate the variables and use them within the same subshell in a pipeline.
set | {
shopt -s extglob
int_vars=()
while IFS='=' read -r var value; do
if [[ $value == +([[:digit:]]) ]]; then
int_vars+=($var)
(( sum += value ))
fi
done
echo "${int_vars[*]}"
echo $sum
}