# a single first slash means first occurrence
# format=${haystack/needle/replacement}
# if you use a double first slash it means ALL occurrences
# format=${haystack//needle/replacement}
email=${file/.txt-marked/}
In the example above we are searching in the variable $file for ".txt-marked" and replacing with nothing (the empty part after the last / means we are replacing with nothing or actually removing it).
How to replace all occurrences?
email=${file//.txt-marked/}
The only difference is where the first slash goes. If you use double slashes it means to replace ALL occurences.
bash, manipulate, text, searchig, replacing, natively, slash, occurrence, format, haystack, replacement, occurrences, email, txt, marked, variable, quot, removing, slashes, occurences,