Created
August 3, 2016 15:02
-
-
Save johnrizzo1/4d655bbed72a04667cddf906c63c327b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Purpose: Read a file and parse each line into two variables | |
# File Format | |
# Each line is a space separated set of fields | |
# $first - the first field in the file | |
# $rest - all remaining fields in the file | |
while read i | |
do | |
echo $i | |
first=${i[(w)0]} | |
print "\tFirst: $first\n" | |
rest=${i[(w)1:2]} | |
print "\tRest: $rest\n" | |
done < test_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment