
zprofile: export PATH="$PATH:$HOME/scripts" I added that folder to my PATH like so in my. The way I do it is in my home directory, I have a folder called scripts. There’s multiple ways to expose a bash script to your PATH so it can be run anywhere.

We use find with a depth of 1 so that we don’t get do down subdirectories. I like to do this to just verify that the script is running in the right place.

We get a count of HEIC files in the directory it’s being run in and write that to count stdout.This is a great article on safe shell scripting that delves into that more deeply. First, we set some bash settings to give us saner behavior in regards to errors.
