Posts

Showing posts with the label quoting

How to escape single quotes within single quoted strings?

How to escape single quotes within single quoted strings? Let's say, you have a bash alias like: alias alias rxvt='urxvt' which works fine. However: alias rxvt='urxvt -fg '#111111' -bg '#111111'' won't work, and neither will: alias rxvt='urxvt -fg '#111111' -bg '#111111'' So how do you end up matching up opening and closing quotes inside a string once you have escaped quotes? alias rxvt='urxvt -fg'''#111111''' -bg '''#111111''' seems ungainly although it would represent the same string if you're allowed to concatenate them like that. Do you realise that you don't need to use single quotes for alias? Double quotes is much easier. – teknopaul Jan 9 '16 at 23:58 See also: Difference betwee...