Subj : Re: AI Written Bash Script To : DrStevenStrange From : =?UTF-8?Q?Josef_M=C3=B6llers?= Date : Thu Dec 12 2024 14:35:32 On 12.12.24 13:43, DrStevenStrange wrote: > Ok - don't laugh > > My coding skills are pitiful so I asked my resident Ai to write a bash > script to call a webcam script (I did write this one) only between > sunrise and sunset. it produced this and it works! My question is - how > can I amend the script so it starts 30 minutes BEFORE sunrise and stops > 30  Minutes after? [...] > SUNRISE_EPOCH=$(date -d "$SUNRISE" +%s) > SUNSET_EPOCH=$(date -d "$SUNSET" +%s) > CURRENT_EPOCH=$(date +%s) Since you already have the date/time in seconds since the epoch, just subtract 30 seconds for BEFORE and add 30 seconds for AFTER Josef --- SoupGate-Win32 v1.05 * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3) .