In a bash script, I'm looking for a way to set each matching line of a file into its own variable, or variable array.
As an example, i have a crontab file with several entries:
00 23 * * * /usr/local/bin/msqlupdate -all
00 11 * * * /usr/local/bin/msqlupdate -inc
00 03 * * * /usr/local/bin/msqlupdate -inc
00 18 * * * /usr/local/bin/msqlupdate -inc
So I'm trying to grab each line, put it into a variable that can be modified.
i.e. var[1] = line 1
var[2] = line 2 etc...
I think the '*' are throwing off everything I'm trying.
Thanks for any assistance.