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
3
votes
2 answers

How to load STDIN for a backtick in perl (without writing to a temp file)

I'm executing a system command, and wanting to (1) pre-load STDIN for the system command and (2) capture the STDOUT from the command. Per here I see I can do this: open(SPLAT, "stuff") || die "can't open stuff: $!"; open(STDIN, "<&SPLAT") || die…
Jonathan M
  • 17,145
  • 9
  • 58
  • 91
2
votes
1 answer

MySQL : When stored procedure parameter name is the same as table column name [continue]

Let's say a have a stored procedure SetCustomerName which has an input parameter Name, and I have a table customers with column Name. So inside my stored procedure I want to set customer's name. If I write UPDATE customers SET Name = Name; this is…
nightcoder
  • 13,149
  • 16
  • 64
  • 72
2
votes
4 answers

Evaluating command with Awk

The problem is that: I have different txt files in which is registered a timestamp and an ip address for every malware packet that arrives to a server. What I want to do is create another txt file that shows, for every ip, the first time a malware…
papafe
  • 2,959
  • 4
  • 41
  • 72
2
votes
1 answer

Perl backticks subprocess is causing EOF on STDIN

I'm having this issue with my perl program that is reading from a file (which I open on STDIN and read each line one at a time using $line = <>). After I execute a `backtick` command, and then I go to read the next line from STDIN, I get an…
snoopyjc
  • 621
  • 4
  • 11
2
votes
6 answers

Perl backticks using bash

In Perl, the default shell to execute backticks is sh. I'd like to switch to use bash for its richer syntax. So far I found that the suggested solution is `bash -c \"echo a b\"` The apparent drawback is that the escaped double quotes, which means I…
oldpride
  • 761
  • 7
  • 15
2
votes
1 answer

Require exit status !=0 for the main script if script within the system command/backtick fails

Code of inter.pl is: use strict; use warnings; my $var1=`cat /gra/def/ment/ckfile.txt`; #ckfile.txt doesn't exist print "Hello World"; exit 0; When I execute inter.pl ( perl inter.pl), and check the exit status, I see it as 0. I know the reason…
AskQuestionsP
  • 153
  • 1
  • 9
2
votes
0 answers

Convert CreateElement to backtick not work

I am working on "createElement" with "backtick". Because it works faster. I will add 4-5 elements. So I want to use "backTick". I tried to convert the "createElement" clause to "Backthick". But I get the error message "ReferenceError: Grid not…
omerix
  • 149
  • 1
  • 12
2
votes
1 answer

equivalent of unix `` (backticks) in DOS?

Possible Duplicate: Batch equivalent of Bash backticks In unix we use `` for command output substitution. e.g. export a=`pwd` Is there any equivalent for this (``) in DOS command prompt?
M K Saravanan
  • 359
  • 1
  • 4
  • 12
2
votes
1 answer

How to write Backticks in Intellij IDEA 2019.2?

I just updated Intellij to 2019.2 and I'm not able to use the "AltGr + ` " anymore to write backticks. I can copy paste and use it, it has the same effects, but I'm unable to type it. Is it a bug ? Or should I configure something ? I'm using a…
Rafaël
  • 977
  • 8
  • 17
2
votes
1 answer

perl: Here documents inside backtick operator

Given a program utility that takes commands from stdin and returns a useful exit code, this perl syntax works: my $result = `utility -switch1 -switch2 <
Thomas L Holaday
  • 13,614
  • 6
  • 40
  • 51
2
votes
1 answer

Is there an alternate syntax in Ruby for backticks?

In Ruby you can do a + b, which is equivalent to a.+(b). You can also override the +() method with def +(other); end. Is there an alternate syntax for backticks? I know that this works: class Foo def `(message) puts '<' + message + '>' end …
jleeothon
  • 2,907
  • 4
  • 19
  • 35
2
votes
2 answers

Getting a Parsing error on a template string with ESLint, but I have ECMA 6 in config file

I can post my whole config and JavaScript file if needed, but I am trying to run ESLint on some JavaScript I'm writing. My 'eslintrc.json' file has this in the config (with some other rules): "rules": { // Thought this was my issue and hoped it…
2
votes
1 answer

Substitution for Backticks in Internet Explorer

I have a backtick in my javascript to make my website render correctly on mobile chrome. The problem is that the backtick, while not needed in IE, causes everything in the javascript for IE to error and stop working. I tried simply replacing it with…
SideSlaw
  • 39
  • 6
2
votes
0 answers

Call a method named `var` in Scala

I am using a third-part Java library, which defines a method named var. In Java, that is not a problem. In Scala, varis a reserved word and obj.var() gives a compilation error. Is there a more elegant solution to this than…
Troy Daniels
  • 3,270
  • 2
  • 25
  • 57
2
votes
2 answers

Comparison between normal array vs generated by back-tick array

I am creating an array by two way. my first way is creating an array normally my second way is creating an array by using backticks function let array=["1234"]; function createArrayByBakticks(obj) { return obj; } let backtickArray =…
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234