Input:
i="Item1;Item2;Item3;;;;;;;;"
Desired output:
i="Item1;Item2;Item3"
How do I get rid of the last few semicolons?
I know this one way to do it using 'sed':
sed 's/;$//'
However, it only removes the last semicolon. Running it repeatedly doesn't seem practical.