Questions tagged [backticks]

For questions relating to the backtick character (`), also known as the backquote, which has various special meanings in computing.

A backtick or backquote or grave accent is the character,

       `

On British and American QWERTY keyboards, this is located in the upper left corner, next to the 1 key. It is notoriously difficult to type on some European keyboards, requiring up to four keystrokes.

Backticks were introduced by Unix shells to run a sub-shell. The concept has been adopted by other languages and tools such Perl, PHP, Ruby, and Make. The newer alternative syntax $(<command>) in POSIX-compliant shells is more flexible as it allows nesting.

In Python 2, backticks enclose an expression to be evaluated and converted to its string representation. This feature was removed in Python 3, as it was deemed not sufficiently beneficial to warrant the syntax. The same effect can be accomplished with repr() instead.

In Markdown, backticks are used as a shorthand for emitting <code></code> tags in HTML.

In TeX typesetting, a backtick renders as an opening curly quote (‘).

In the programming languages D and Go, backticks surround string literals.

Further uses of backticks in computing can be found in the Wikipedia article on the grave accent.

311 questions
7
votes
3 answers

Bash completion inside backticks or $() using complete

Consider this one-liner to activate bash completion for foobar: complete -F _known_hosts foobar This shows a list of completion options for > foobar but not for > $(foobar or > `foobar I think it makes a lot…
mnieber
  • 992
  • 9
  • 23
7
votes
2 answers

PhpStorm - Backticks ` for ES6 template strings broken

When using backticks in a JavaScript file such as : var name = 'Tom'; var greeting = `hello my name is ${name}`; PhpStorm does all sorts of weird auto-formatting that breaks the file. Backticks randomly appear or disappear, commenting the rest of…
6
votes
2 answers

Does Kotlin allow the use of backtick names for test classes?

Kotlin/JUnit advertise the use of backticked function names for tests. I've discovered that you can also use backticked class names... But I can't find any reference. Is thing something in the Kotlin specification, or just a "may go away soon"…
David Hope
  • 2,216
  • 16
  • 32
6
votes
1 answer

How to escape the "`" backtick character in a .rst file?

I want to write the following sentence: Don't forget to escape the :code:`\`` character, it will be interpreted as code mark But I don't know how to escape the "`" backtick character. Is it even possible?
Pierrick Rambaud
  • 1,726
  • 1
  • 20
  • 47
6
votes
3 answers

Why does Kotlin data class objects have backticks?

This is my data class created using a Kotlin data class creator Plugin. data class ResponseHealthInisghts( val `data`: List, val message: String, val statusCode: Int ) This code gets work even if I remove the backticks, I wonder if it's for…
Manoj Perumarath
  • 9,337
  • 8
  • 56
  • 77
6
votes
3 answers

use perl's qx{} / `...` operator with a list of arguments

system, exec, open '|-', open2, etc. all allow me to specify the command to run as a list of arguments that will be passed directly to execvp instead of run through a shell. Even if perl is smart enough to run it directly if it looks like a "simple"…
user10678532
6
votes
2 answers

Bash complains about syntax errors in here-document when using backticks

I'm running the following piece of bash code: cat << END_TEXT _ _ | | | | __ _| |__ ___ __| | / _` | '_ \ / __/ _` | | (_| | |_) | (_| (_| | \__,_|_.__/ \___\__,_| END_TEXT and am getting an error: bash:…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
6
votes
1 answer

Does Tcl have an equivalent of PERL and Ruby backtic

In Ruby/PERL, I can very easily get the console output of a system command fed into a file. For example: $k = `ls` Would input the output of ls into variable $k in PERL (and Ruby). How can one do something like this in Tcl? Thanks
user1134991
  • 3,003
  • 2
  • 25
  • 35
6
votes
2 answers

Start another Rails Server from within Rails App with backticks

I'm currently working on a Rails application that serves as an Updater for another Rails application. I have the update process working, Download new release zip Extract to proper location Sync Assets Bundle install Precompile Assets Start server…
Mike George
  • 521
  • 3
  • 11
  • 27
6
votes
3 answers

bash pipestatus in backticked command?

in bash, if I execute a couple of commands piped together inside of backticks, how can I find out the exit status of the first command? i.e. in this case, I am trying to get the "1". which I can get via PIPESTATUS[0] if I am not using backticks, but…
jerry
  • 63
  • 1
  • 4
5
votes
2 answers

Vue JS v-bind image src attribute combining path string with object value not working

Clearly I'm missing something simple here. Inside a template I'm simply trying to add a path to an image file name sourced from an object. I've tried a bunch of things, back ticks mustaches, etc. but Vue doesn't like any of them. How do I format…
Loomernescent
  • 81
  • 2
  • 7
5
votes
1 answer

F#: Double backticked value names clash with function names?

In Visual Studio 2015: let myFunction (``string`` : string) = "\"Quoted string\"" |> (Regex "\"[^\"]*\"").Match |> string let myOtherFunction (str : string) = "\"Quoted string\"" |> (Regex "\"[^\"]*\"").Match |> string First function…
MiloDC
  • 2,373
  • 1
  • 16
  • 25
5
votes
2 answers

Ruby limit on string substitutions in a backtick expression?

Ok, so I am trying to execute the following code: `#{@daemon_path} --name=#{@app_name} --command=#{@java_path} -- -jar #{jetty_jar} #{@war_path} #{random_port}` sleep(10) #give war time to error out and die if its going to `#{@daemon_path}…
Nicholas Terry
  • 1,812
  • 24
  • 40
5
votes
1 answer

Why did I have to use backticks around the table name in my MySQL query?

As far as I have read, backticks are not required around, for example, table names in queries: ("INSERT INTO table_name...."). In addition, to my knowledge, underscores are perfectly acceptable syntax to use in names: foo_bar. My question then is,…
John Zimmerman
  • 163
  • 2
  • 7
5
votes
2 answers

How do I expand variables in Perl readpipe handlers?

It seems that variables in backticks are not expanded when passed onto the readpipe function. If I override the readpipe function, how do I expand variables? BEGIN { *CORE::GLOBAL::readpipe = sub {print "Run:@_\n"}; } `ls /root`; my $dir =…
Sandip Bhattacharya
  • 1,042
  • 10
  • 11