Hello I have two vars loaded with
$VAR1="ISOMETHING103"
$VAR2="COTHERTHING04"
I need to:
1) Strip the first char. Could be sed 's/^.//'
2) The number has it's rules. If it has "hundreds", it needs to be striped.
If it is just two digits it shouldn't.
So, for VAR1 output should be "SOMETHING03".
And for VAR2 output should be "OTHERTHING04".
My main issue here is how can I strip the "hundreds"?
Input would be all caps always.
produces the same output.
Both of these suggestions use parameter expansions that are extensions that are allowed, but not specified, by the standards.
---------- Post updated at 01:34 PM ---------- Previous update was at 01:26 PM ----------
I am amazed! Thanks a lot for your quick answers.
It looks to me that the awk solution is the more "portable" option, and since this needs to be used in many flavors of Linux/Unix, y expect to work ok.
I will report back
Very very very thank you to all of you.
Sebastian