Running a user script through cron

Imagine you want to run whatever.sh through cron in a Linux system (I’ve tried Ubuntu/Debian only, but this might be applicable to other distributions). You’ll find that despite whatever.sh being run properly if you do it manually, cron won’t be able to run it properly because it cannot find the binaries that are available to your user.
To fix this, simply put this line as the first one on any user script that you run through cron:

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"