Subj : Re: AI Written Bash Script To : DrStevenStrange From : =?UTF-8?Q?Josef_M=C3=B6llers?= Date : Thu Dec 12 2024 14:36:55 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? [...] > # Convert sunrise and sunset times to seconds since epoch > SUNRISE_EPOCH=$(date -d "$SUNRISE" +%s) > SUNSET_EPOCH=$(date -d "$SUNSET" +%s) > CURRENT_EPOCH=$(date +%s) Since you already have the date/times in seconds since the epoch, just add/subtract 30 minutes worth of seconds for AFTER and BEFORE! Josef --- SoupGate-Win32 v1.05 * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3) .