All Questions

424
votes
10answers
115600 views

When to use single quotes, double quotes, and backticks in MySQL

I am trying to learn the best way to write queries. I also understand the importance of being consistent. Until now, I have randomly used single quotes, double quotes, and backticks without any real t...
275
votes
3answers
73102 views

Difference between single and double quotes in Bash

In Bash, what are the differences between single quotes ('') and double quotes ("")?
63
votes
4answers
16499 views

When to wrap quotes around a shell variable?

Could someone tell me whether or not I should wrap quotes around variables in a shell script? For example, is the following correct: xdg-open $URL [ $? -eq 2 ] or xdg-open "$URL" [ "$?" -eq "2" ...
213
votes
6answers
182666 views

Insert text with single quotes in PostgreSQL

I have a table test(id,name). I need to insert values like: user's log, 'my user', customer's. insert into test values (1,'user's log'); insert into test values (2,''my users''); insert into tes...
837
votes
24answers
823629 views

How to output MySQL query results in CSV format?

Is there an easy way to run a MySQL query from the Linux command line and output the results in CSV format? Here's what I'm doing now: mysql -u uid -ppwd -D dbname << EOQ | sed -e 's/ ...
258
votes
5answers
15516 views

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

I'm curious about this code: cout << 'test'; // Note the single quotes. gives me an output of 1952805748. My question: Is the output an address in memory or something?
32
votes
6answers
21857 views

Regex to pick commas outside of quotes

I'm not quite sure if this is possible, so I turn to you. I would like to find a regex that will pick out all commas that fall outside quote sets. For example: 'foo' => 'bar', 'foofoo' => 'b...
73
votes
8answers
278640 views

How to enter quotes in a Java string?

I want to initialize a String in Java, but that string needs to include quotes; for example: "ROM". I tried doing: String value = " "ROM" "; but that doesn't work. How can I include "s within a str...
190
votes
4answers
170074 views

Expansion of variable inside single quotes in a command in Bash

I want to run a command from a bash shell script which has single quotes and some other commands inside the single quotes and a variable. e.g. repo forall -c '....$variable' In this format, $ is esc...
175
votes
11answers
356805 views

Escape quotes in JavaScript

I'm outputting values from a database (it isn't really open to public entry, but it is open to entry by a user at the company -- meaning, I'm not worried about XSS.) I'm trying to output a tag like t...

Previous Next