Could you please show us an
actual example or two of the text stored in both variables, and what you want from them?
I have a feeling that you are making this much more complicated than it needs to be. I'm betting that you can probably do what you want with a simple
parameter substitution or two, or some other form of built-in
string manipulation.
But as a first bit of advice,
$(..) is highly recommended over `..`. Backticks are generally deprecated.
And please use ***
[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do
not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.
Edit: As a concept example, assuming
bash, and assuming that you want to simply remove the last ten digits from the number:
Code:
$ var=1234567890987654321
$ echo ${var:(-10)}
0987654321
$ echo "${var%${var:(-10)}}"
123456789
Or even simply:
Code:
$ echo "${var%??????????}"
123456789