read text file line by line and use it as variable in shell script code example Example: read file line loop in bash for word in $(cat peptides.txt); do echo $word; done