Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- check_scrabble()
- {
- local score=0
- local json_data='{
- "1": ["A", "E", "I", "O", "U", "L", "N", "R", "S", "T"],
- "2": ["D", "G"],
- "3": ["B", "C", "M", "P"],
- "4": ["F", "H", "V", "W", "Y"],
- "5": ["K"],
- "8": ["J", "X"],
- "10": ["Q", "Z"]
- }'
- item="DOG"
- for ((j=0; j<${#item}; j++)); do
- echo "Element at index $j: ${item:$j:1}"
- for entry in $(echo "$json_data" | jq '.[] | select(.[] | contains("${item:$j:1}"))'); do
- echo "inside for loop $entry"
- done
- done
- }
- main () {
- check_scrabble "$@"
- }
- main "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement