I have a variable which looks like xx-xx-xx-xx where each xx is a number (length of each xx is unknown)
I need to extract those numbers in separate variables to be able manipulate them. I tried to look at regular expressions but couldnt see any solution (or i am just blind enough not to notice.
Ideally solution should look like
#!/bin/sh
# assume VARIABLE equals 1234-123-456-890
VARIABLE=$1
# HERE SOME CODE assigning variables $PART1 $PART2 $PART3 $PART4
echo $PART1-$PART2-$PART3-$PART4
# Output will give us back 1234-123-456-890
I am quite new to shell scripting so i might have missed something.