Answers for "bash for loop over lines in file"

12

bash iterate over lines of a file

while read p; do
  echo "$p"
done <peptides.txt
Posted by: Guest on March-05-2020
1

bash loop over files in file

# Basic syntax:
for filename in `cat file_of_filenames.txt`; do
	echo $filename
done

# This iterates through each of the filenames listed in the 
#	file_of_filenames.txt
# Note, the filenames should be separated by spaces or new-lines
Posted by: Guest on June-26-2021
0

bash loop lines in file

#!/bin/bash
filename='peptides.txt'
echo Start
while read p; do 
    echo $p
done < $filename
Posted by: Guest on April-26-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language