I'm looking for something that will translate a string as follows, using only bash / standard Linux commands:
- Single-quotes surrounding a string should be removed
- Double-quotes surrounding a string should be removed
- Unquoted strings should remain the same
- Strings with unmatched surrounding quotes should remain the same
- Single-quotes that don't surround the string should remain
- Double-quotes that don't surround the string should remain
For example:
- 'Food' should become Food
- "Food" should become Food
- Food should remain the same
- 'Food" should remain the same
- "Food' should remain the same
- 'Fo'od' should become Fo'od
- "Fo'od" should become Fo'od
- Fo'od should remain the same
- 'Fo"od' should become Fo"od
- "Fo"od" should become Fo"od
- Fo"od should remain the same
Thank you!