At times you might want to read a file or give your shell a file to take input from it. I had the same situation while I was practicing at home. So, here is the code that worked out for me. Hope this can help you too. I might edit this page latest if I find better way of doing the same. So, here is the code for you.
for i in $infile; do
Here is yet another script that gives you the exact out put. This script reads the line using while loop in shell.
while read line
infile is a file that is in the same directory where the script exists.
If you like this article, then please consider sharing it. Sharing really inspires us to do things much better!!