I think all you’re looking for is to read multiple variables per line: the read
command can assign words to variables by itself.
while read -r first second third; do
do_stuff_with "$first"
do_stuff_with "$second"
do_stuff_with "$third"
done < ./test.txt
More Related Contents:
- In the shell, what does ” 2>&1 ” mean?
- Difference between single and double quotes in Bash
- Command not found error in Bash variable assignment
- How to check if a variable is set in Bash
- Shell equality operators (=, ==, -eq)
- redirect COPY of stdout to log file from within bash script itself
- I just assigned a variable, but echo $variable shows something else
- Shell script to delete directories older than n days
- Shell: How to call one shell script from another shell script?
- Quick-and-dirty way to ensure only one instance of a shell script is running at a time
- Process all arguments except the first one (in a bash script)
- How to represent multiple conditions in a shell if statement?
- Generating permutations using bash
- What is the difference between ${var}, “$var”, and “${var}” in the Bash shell?
- What does the Bash operator
- Remove duplicate entries in a Bash script [duplicate]
- source command not found in sh shell
- How to parse a CSV in a Bash script?
- How to check if a file contains a specific string using Bash
- What’s a concise way to check that environment variables are set in a Unix shell script?
- Source files in a bash script
- executing shell command in background from script [duplicate]
- Waiting for background processes to finish before exiting script
- Variables as commands in Bash scripts
- How to split a file into equal parts, without breaking individual lines? [duplicate]
- Assign a makefile variable value to a bash command result?
- Parse HTML using shell
- Renaming files with Bash, removing prefix and suffix
- docker entrypoint running bash script gets “permission denied”
- What does `kill -0 $pid` in a shell script do?