If I have a bash string in a variable. How do I extract/retrieve that string except for the last character, and how easy would it be if I want to extract until the last two characters?
Example:
# Removing the last character
INPUT="This is my string."
# Expected output "This is my string"
# Removing the last two characters
INPUT="This is my stringoi"
# Expected output "This is my string"