bash regex with quotes?

It was changed between 3.1 and 3.2. Guess the advanced guide needs an update. This is a terse description of the new features added to bash-3.2 since the release of bash-3.1. As always, the manual page (doc/bash.1) is the place to look for complete descriptions. New Features in Bash snip f. Quoting the string argument … Read more

Escape quotes in JavaScript

You need to escape the string you are writing out into DoEdit to scrub out the double-quote characters. They are causing the onclick HTML attribute to close prematurely. Using the JavaScript escape character, \, isn’t sufficient in the HTML context. You need to replace the double-quote with the proper XML entity representation, ".

What do single quotes do in C++ when used on multiple characters?

It’s a multi-character literal. 1952805748 is 0x74657374, which decomposes as 0x74 -> ‘t’ 0x65 -> ‘e’ 0x73 -> ‘s’ 0x74 -> ‘t’ Edit: C++ standard, §2.14.3/1 – Character literals (…) An ordinary character literal that contains more than one c-char is a multicharacter literal . A multicharacter literal has type int and implementation-defined value.

Expansion of variables inside single quotes in a command in Bash

Inside single quotes everything is preserved literally, without exception. That means you have to close the quotes, insert something, and then re-enter again. ‘before'”$variable”‘after’ ‘before'”‘”‘after’ ‘before’\”after’ Word concatenation is simply done by juxtaposition. As you can verify, each of the above lines is a single word to the shell. Quotes (single or double quotes, depending … Read more

Difference between single and double quotes in Bash

Single quotes won’t interpolate anything, but double quotes will. For example: variables, backticks, certain \ escapes, etc. Example: $ echo “$(echo “upg”)” upg $ echo ‘$(echo “upg”)’ $(echo “upg”) The Bash manual has this to say: 3.1.2.2 Single Quotes Enclosing characters in single quotes (‘) preserves the literal value of each character within the quotes. … Read more