Created
August 13, 2019 13:31
-
-
Save jozko/5c74f3dde788ad75cf747f2a3dd6964a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Interpolation to {} is not possible in bash | |
# see https://www.gnu.org/software/bash/manual/html_node/Shell-Expansions.html#Shell-Expansions | |
# So using a counter and an array may come handy sometimes | |
MAX_COUNT=6 | |
arr=() | |
while true; do | |
((counter++)) | |
arr="$arr $counter" | |
if [[ "$counter" -eq ${MAX_COUNT} ]]; then | |
break | |
fi | |
done | |
echo $arr | |
for e in $arr | |
do | |
echo $e | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment