You can do this with standard linux utilities:
lsblk -n --scsi --output PATH,RM | \
grep 0 | \
awk -F ' ' '{print $1}'
lsblk --scsi --output PATH,RM
will list all SCSI devices along with the path to them and whether they are removable or not. On my system, it looks like this:
/dev/sda 1
/dev/sdb 0
/dev/sdc 0
/dev/sdd 0
/dev/sde 0
Removable devices will have a 1 in the second column and non-removable devices will have a 0. We filter the list to only those non-removeable devices and output the first field which is the path to the device. This will give you a list like this:
/dev/sdb
/dev/sdc
/dev/sdd
/dev/sde
Saving that in a variable will allow you to loop over the path to each non-removable drive in your system.
$ export DEVICES=$(lsblk -n --scsi --output PATH,RM | grep 0 | awk '{print $1}')
$ for DEVICE in $DEVICES; do echo $DEVICE; done
/dev/sdb
/dev/sdc
/dev/sdd
/dev/sde