[Bash] Reading from Standard Input

To read from standard input in a Bash shell, use read. The following script reads content from stanard input and outputs the content:

#!/bin/sh

# Uncomment this to use comma as a separator.
# IFS=","

read first second third
echo first=\"${first}\" second=\"${second}\" third=\"${third}\"

Read more of this post

Advertisements