Bash script text line into an array
I am trying to read a command and pipe each line into an array.
I want to read: $chkconfig --list After I read that command I want to parse each line into 2-d array. I figure out out to get first line with awk, but not sure how to make it loop till EOF. $chkconfig --list, when output is just one big text word. It does not preserve the newlines. I wish I token on newlines instead "6:off", because we know runlevel 6 will be off(or should be) Anyone got in good resources I could look at? |
This might work:
Code:
chkconfig --list | while read line Code:
chkconfig --list | while read line |
All times are GMT -5. The time now is 07:26 PM. |