Use of sed to find everything after first match!

Hi Guys
So far I have got this to work:

set x = temp1:temp2:temp3

echo $x | sed 's/.*:\(.*\).*/\1/'
Answer:
temp3

But I want answer as temp2:temp3, that is everything after the first ":" is found. If anybody can help with a bit of description that will be great.

Thanks in Advance

This is very similar to your previous thread. Is there a theme developing, or shall we continue in dribs and drabs?

# X=1:2:3                                                                                                 
# echo $X | sed "s/[^:]*://"
2:3
# echo ${X#*:} 
2:3
1 Like