I would like to create a bash script that selects the first word of each line from a text file before the ":" character, and outputs it in an array (1 slot for 1 line).
Right now I have this:
while read p; do arr+=$p | sed -r 's///' done <test.txt
and I can't figure out what to put in the condition of the sed.
I have this regexep :