Article 54WDK How to read line by line a variable in bash? (Slackware Packages)

How to read line by line a variable in bash? (Slackware Packages)

by
slac
from LinuxQuestions.org on (#54WDK)
I'm saving a list of files to a bash variable and I want to read that variable line by line.

The code for saving the file list to a variable is:

Code: filelist_number="$((1 + "$(grep -n "FILE LIST:" /var/lib/pkgtools/packages/sc-7.16-x86_64-8 | cut -d : -f 1)"))"
filelist="$(sed -n "${filelist_number},\$p" /var/lib/pkgtools/packages/sc-7.16-x86_64-8)"
echo "${filelist}"... and now I want to read "${filelist}" line by line. An example just doing "echo" of each line should be sufficient.latest?d=yIl2AUoC8zA latest?i=pVbCFP2Qfgs:coEKGPS8jMQ:F7zBnMy latest?i=pVbCFP2Qfgs:coEKGPS8jMQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=pVbCFP2Qfgs:coEKGPS8jMQ:gIN9vFwpVbCFP2Qfgs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments