I have the String like
something0^^^something1^^^something2^^^something3
I want Only String
something0^^^something1^^^something2
by removing
^^^something3
How can i get it in shell script
Using pure BASH:
s='something0^^^something1^^^something2^^^something3'
echo "${s/^^^something3/}"
something0^^^something1^^^something2
OR you can just delete everything after last ^^^:
echo "${s%^^^*}"
something0^^^something1^^^something2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With