This post shows how list files in a directory using a shell script.

This is the code:

#!/bin/bash
while read line
do                
    echo "File: " $line
done < <(ls -1 /someDir)

ciao