Article 5K65H reading multi-word arguments from a file in bash

reading multi-word arguments from a file in bash

by
lvm_
from LinuxQuestions.org on (#5K65H)
Is it possible to parse a space-delimited text file with some of the arguments being multi-word quoted strings using plain bash functions if changing IFS is not an option? E.g. if text line is

Code:"1 2" 3when I execute

Code:read a bI want to get

Code:a=1 2
b=3instead of

Code:a="1
b=2" 3latest?d=yIl2AUoC8zA latest?i=GIEFfhZF4A8:By8WuJD-tPc:F7zBnMy latest?i=GIEFfhZF4A8:By8WuJD-tPc:V_sGLiP latest?d=qj6IDK7rITs latest?i=GIEFfhZF4A8:By8WuJD-tPc:gIN9vFwGIEFfhZF4A8
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