Created
May 4, 2011 22:00
-
-
Save flores/956124 to your computer and use it in GitHub Desktop.
assigning variable names to a space delimited, new-line separated file with sh's "while"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ while read firstcolumn secondcolumn thirdcolumn; do | |
> echo -e "First column is $firstcolumn | |
> Third is $thirdcolumn \n" | |
> done << EOF | |
> i like cats | |
> and pie too | |
> baby baby yeah | |
> EOF | |
First column is i | |
Third is cats | |
First column is and | |
Third is too | |
First column is baby | |
Third is yeah | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment