Need help with "read" command
I have a file named /etc/values, with the following 3 lines:
Code:
Gonzales, Juan;California;June Code:
Name: Gonzales, Juan Code:
#!/bin/sh The output I am getting is: Code:
Name: I have read "man bash" and have tried many variations, but still not working right. If you have any tips, or see what I am doing wrong, feel free to point it out. NOTE: The actual file I'll be using will have hundreds of records, delimited by a semicolon. Within the fields, there will be spaces and commas. |
I'd use awk to do this, as it's perfect for this -- the following ought to work:
Code:
awk -F';' '{print "Name: ", $1, "\nState: ", $2, "\nMonth: ", $3, "\n\n"}' < /etc/values |
All times are GMT -5. The time now is 10:08 PM. |