I have a Variable like below.
1.1.0.1580308800316
Is there a way to get 1.1.0 as a separate variable and 1580308800316 as a separate variable? Like var1=1.1.0 and var2=1580308800316
I tried the following code line which I could find.
echo 1.1.0.1580308800316 | fold -w6
But it didn't bring me the result I wanted.
``
Though IMHO you could create 2 elements out of your text and could save in 2 elements of an array and then make use of that array items one by one, since OP insisted to have variables only, so you could use cut
command for this one.
first_var=$(echo "1.1.0.1580308800316" | cut -d'.' -f1-3)
second_var=$(echo "1.1.0.1580308800316" | cut -d'.' -f4)