Link to home
Start Free TrialLog in
Avatar of DevSupport
DevSupport

asked on

sed remove last character of file but not every last character

Hi Experts,
I am having trouble stripping only the last character and second last, of a variable

before sed:
107005075456+
1019918397440+
182400823296+
53550772224+
1810193428480+
+

expected result:
107005075456+
1019918397440+
182400823296+
53550772224+
1810193428480

we tried sed -e 's/\+$//' but its stripping all + but I want to get rid of only the last + and the one on the second last line

Could you please help!
SOLUTION
Avatar of Abhimanyu Suri
Abhimanyu Suri
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Alternatively add a number at the end, 0
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DevSupport
DevSupport

ASKER

Thank You so much for helping!!