Last active
September 21, 2021 18:23
-
-
Save Pzoom522/e6e0384c97b9b29db5be5aab746ee706 to your computer and use it in GitHub Desktop.
shell script to traverse all language pairs
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
#!/bin/bash | |
function traverse(){ | |
lang_list=($1) | |
ban=0 | |
for i in "${!lang_list[@]}" | |
do | |
ban=$((ban + 1)) | |
# echo "$ban" | |
for j in "${!lang_list[@]}" | |
do | |
if ((j >= ban)); then | |
echo "${lang_list[$i]}"-"${lang_list[$j]}" | |
fi | |
done | |
done | |
} | |
# test | |
langs=(en de es fr hi pl) | |
traverse "${gats_langs[*]}" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment