bash get line in file code example

Example 1: bash print output to one line

# Basic syntax:
<command_producing_multi-line output> | tr '\n' ' '
# Where:
#	- | sends (pipes) the multi-line output of your command to tr
#	- tr '\n' ' ' translates all new line characters from the multi-line 
#		output to spaces, resulting in all output on a single line. 
# Note, change ' ' to whatever delimiter you want between the lines now
#	displayed on a single line (e.g. ',' or ';' or '|')

Example 2: read file line loop in bash

for word in $(cat peptides.txt); do echo $word; done