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
1
vote
0 answers

When to use inline backticks in documentation

When writing documentation, what things should be put in inline backticks? For example I use inline backticks for the following, commands E.g. "To run the program, run python3 helloworld.py" example output E.g. "python3 helloworld.py should…
1
vote
1 answer

How to add "backtick" (`) with a Turkish keyboard?

I am using a Turkish keyboard and I couldn't find a way to add backticks. Can you please help?
Fazıl Src
  • 63
  • 7
1
vote
2 answers

How to catch PHP backtick operator usage via PHP_CodeSniffer?

I've studied some "sniffs" from the "Generic" and "Squiz" coding standards that come with CodeSniffer version 1.3, and learned enough to write a few "custom" sniffs to catch some coding anti-patterns which are specific to a PHP project that I'm…
Peter
  • 2,526
  • 1
  • 23
  • 32
1
vote
2 answers

Inability to capture output from "dd" using backticks

I've been working with a very old Solaris system and not in a position to add more modules to make my life easier, and I'm working with a number of scripts that use various command line options. The majority of what I'm working on is, in fact…
Netmaster
  • 11
  • 2
1
vote
0 answers

Rendering words within text that is commented out in R chunk possible?

In a Rmarkdown document and outside a chunk, a word within backticks, for example text, will show as text in the corresponding rendered document. Is there a way to do the same with words within a text that is commented out inside an R chunk? For…
ForEverNewbie
  • 357
  • 2
  • 10
1
vote
0 answers

Why backticks are required when matching Strings in Scala?

So I had an error where a match expression always yielded unreachable cases looking like this. class KeyControl(left: String, right: String, up: String, down: String){ def direction(key: String): (Int, Int) = { key match{ case left =>…
Tarmiac
  • 846
  • 1
  • 8
  • 14
1
vote
2 answers

String -like comparison failing when it includes "`" (Acute) character in PowerShell

Below comparison is giving false result in PowerShell , Want it to be true. ` operator is causing it to be false whereas for any other special character it is returning true. > 'abc`@01' -like 'abc`@01' False
1
vote
1 answer

System command ( sed ) in perl

I am inside a perl input file handle loop ,(while FH), and I need to perform search and delete operation to another file in the that loop. I want to perform sed operation on a file from the loop and want to capture the output of command/sed to an…
1
vote
1 answer

Perl alternatives for asynchronous script execution when forking is disallowed and backticks and system() do not work?

Update: This has been resolved for system() and backticks by specifying the full path to the external script. I will further investigate the fork issue on my own. Thanks to all for assisting. At How do I run a Perl script from within a Perl script?…
1
vote
1 answer

sed ignoring triple backticks

I want to replace ```javascript something ``` with {code}javascript something {code} Now, when i run sed on a file with javascript something(everything in the same line, no new lines) sed -e 's/```\(.*\)```/{code}\1{code}/' sedfile It outputs…
Pedro Gonzalez
  • 95
  • 2
  • 11
1
vote
1 answer

Mathjax strangely render back-tick in code blocks

I have a TCL code gist embedded in my own website. This page uses MathJax 2.7.5 configed with "TeX-MML-AM_CHTML". However, Mathjax strangely rendered the code between back-ticks in the comments of the code. For example, one line in the source code…
Hanlin
  • 13
  • 3
1
vote
4 answers

How to escape nested single quotes inside back tick or back quote

Let's say we have the following template literal in ES6. `'{"0": "It's Friday today"}'` How do we escape the single quote in the word It's Also, let's say we have the following template literal: `'{"0": "Thursday\nFriday"}'` How do we escape the…
1
vote
1 answer

How to get around using apostrophe in double quotes with Powershell

I am working with Powershell. My issue is that my file path (which does not exist on a local computer) has an apostrophe in it. Powershell is seeing this as a single quote, so it is giving me the following error: The string is missing the…
user401
  • 53
  • 5
1
vote
3 answers

perl two consecutive back ticked shell command do not run

I am trying to write perl script for managing amazon ec2 instances. In part of my code, I have two shell commands, and when I invoke them, the first runs but not the second. I cannot seem to find a good explanation for this. Here is the…
bahti
  • 636
  • 1
  • 7
  • 21
1
vote
1 answer

Problem with backticks in multi-threaded Perl script on Windows

I have a trouble with the following very simple and small Perl script on Windows platform. use strict; use warnings; use threads; use threads::shared; my $print_mut : shared; my $run_mut : shared; my $counter : shared; $counter =…
Dmitry Krivenok
  • 326
  • 3
  • 10