There are a lot of ways. First question: Why do you want the index? Stop and think about what you want to use it for, and maybe you can go directly to the need instead of by steps. Do you want everything to the left (or right) of the ':'?
leftpart=$(echo $first | cut -f 1 -d ':') rightpart=$(echo $first | cut -f 2 -d ':')
Do you want to split it into pieces and handle them individually?
for part in $(echo $first|tr ':' ' ') ; do
echo $part
done You can also try to use the ternary operator if you use a recent bash shell, but I've been having trouble finding a good example. I also often use awk (gawk for the gnu version) which is pretty arcane, but quite useful. Or step up to Python or perl?