Date: July 23, 2024 - 08:08 AM - 175.139.235.17 xev wrote:
#!/bin/bash
# Get the current date and time current_date=$(date +%Y%m%d) current_time=$(date +%H:%M)
# Read the prayer time table file while read -r line; do # Split the line into date and time columns date=$(echo "$line" | cut -d' ' -f1) times=($(echo "$line" | cut -d' ' -f2-))
# Check if the date matches the current date if [ "$date" == "$current_date" ]; then # Loop through the prayer times, skipping the third column for ((i=0; i<${#times[@]}; i++)); do if [ "$i" -ne "2" ]; then if [ "${times[$i]}" == "$current_time" ]; then echo "It's time for prayer!" fi fi done fi done < /path/to/prayer/time/table.txt