Script for rescanning new hdd disks

Hello everyone, I have Fedora 29 OS on my desktop and I’d like to add my hdd disks in the internal enclosure - mobile racks.
But unfortunately, my PC doesn’t find new disks.
In this case, I use this command to rescan them:
echo “- - -” >/sys/class/scsi_host/hostX/scan, where X are numbers of the SATA ports, for instance (from 0 to 4)
I’d like to have a script for rescan all ports, but I can’t write the script, because I don’t know how should I write it for all ports instead X.
Should I use four command like them:
echo “- - -” >/sys/class/scsi_host/host0/scan
echo “- - -” >/sys/class/scsi_host/host1/scan
echo “- - -” >/sys/class/scsi_host/host2/scan
echo “- - -” >/sys/class/scsi_host/host3/scan

or maybe there is another way to compose the command.

You can use a for loop like below:

for i in {0..3} ; do echo "- - -" > /sys/class/scsi_host/host${i}/scan ; done

Thanks, I’ve done it like this:

for Host in $(ls -1 /sys/class/scsi_host/);
do echo “- - -” >/sys/class/scsi_host/$Host/scan;

Out of curioity, does sudo udevadm settle work too?