Assuming that I have a string like this one:
string="1 0 . @ 1 1 ? 2 2 4"
Is it possible to concatenate digits that are next to each other?
So that string
be like: 10 . @ 11 ? 224
?
I found only basic things how to distinguish integers from other characters and how to "connect" them. But I have no idea how to iterate properly.
num=""
for char in $string; do
if [ $char -eq $char 2>/dev/null ] ; then
num=$num$char