Article 57CBA [SOLVED] Subset a variable

[SOLVED] Subset a variable

by
Drosera_capensis
from LinuxQuestions.org on (#57CBA)
Hello everyone,

I wish to subset the columns of a variable, to use it in a while loop, and have not found the way to do it.

For a file set up as follow:
Code:a 1 2 3
b 4 5 6
c 7 8 9And the loop is the following:
Code:while read i < file
do
echo $i
doneAnd I wish to output only the first column:
Code:a
b
cIs it possible to subset the columns of $i using this specific variable?latest?d=yIl2AUoC8zA latest?i=xSueAFYkq68:YHeaAAA-bOw:F7zBnMy latest?i=xSueAFYkq68:YHeaAAA-bOw:V_sGLiP latest?d=qj6IDK7rITs latest?i=xSueAFYkq68:YHeaAAA-bOw:gIN9vFwxSueAFYkq68
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