Method 1 - By iterating each line using while loop
#!/bin/bash
#Name of the text file
txtFile=myFile.txt
echo "Reading text file "$txtFile" ..."
while read x
do
echo $x
done <$txtFile
Method 2 - By using cat (concatenate and display files) command
#!/bin/bash
#Name of the text file
txtFile=myFile.txt
echo "Reading text file "$txtFile" ..."
cat $txtFile
#!/bin/bash
#Name of the text file
txtFile=myFile.txt
echo "Reading text file "$txtFile" ..."
while read x
do
echo $x
done <$txtFile
Method 2 - By using cat (concatenate and display files) command
#!/bin/bash
#Name of the text file
txtFile=myFile.txt
echo "Reading text file "$txtFile" ..."
cat $txtFile