What is the most aesthetic way to to escape a single quote within a single-quoted string in (ba)sh?
问题 In a (ba)sh script of mine, I have, for example: MYVAR='Alice says: "Hello, Bob." But Bob isn't listening.' This is a syntax error, since the ' in isn't ends the single-quoted string. I know I can fix this using MYVAR='Alice says: "Hello, Bob." But Bob isn'"'"'t listening.' But that is sooo ugly... what can I do instead? sh doesn't support MYVAR='Alice says: "Hello, Bob." But Bob isn\'t listening.' Which would have been tolerable, and switching to a double-quotes string is not an option for