I am prompting the user to enter two words separated by space.
I am using read name
to read name and then read last
to read last word
the user inputs like name last
separated by space. But read seems to be reading the
whole line. How can I read the first words and the second word separately?
Read multiple words in linux bash script
bashlinuxshell-script
Best Answer
In general, you can read into an array.
Each line in this printf output corresponds to a single array item.