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
votes
1 answer

PHP backticks in GET/POST request

Using PHP 5.6, I stumbled upon the command execution via backticks and I was wondering how that could prove to be a vulnerability in PHP powered websites. I can understand that the following code:
-1
votes
1 answer

mulitple commands in back tics

I am writing a bash script and i need to run the following command, but i can't seem to figure out how to get it to run, since i need both pairs of commands to be within back tics. Below is the code i am trying to run. VERSION=`getserversion.py`…
-1
votes
1 answer

Why string.replace(/./gm,function(s){...} can not remove newline in multiline string with `backticks` in javascript

plese run the full functional code snippet. function nlin(x){ // I have to use: return x.replace(/[\s\S]/gm, function(e) { return x.replace(/./gm, function(e) { /* the new var e is never 10==e.charCodeAt(0) ! ** THAT…
And
  • 73
  • 2
  • 7
-1
votes
1 answer

Cant execute Mysql query on python that is on a string because backtick/grave cause conflict

I have this query: CREATE TABLE IF NOT EXISTS `configuration` ( `key` varchar(128) NOT NULL, `value` varchar(1024) NOT NULL, PRIMARY KEY (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; It is correctly executed on workbench and on online mysql…
M. Montoya
  • 13
  • 4
-1
votes
1 answer

How to find a string with backticks ('`') via grep?

I need to grep a string from a file, which contains '`' character. How to achieve this? Wrapping string around " and ' doesn't work.
Piotr
  • 173
  • 1
  • 2
  • 11
-1
votes
1 answer

Perl backtick ignores everything past the first space

I have a command my $output = `somecommand parm1 parm2`; When I try to run this Perl script I get the message Can't exec "somecommand" at ..... It seems it is not seeing anything past the first space in between the backticks. I have a friend who…
-1
votes
2 answers

Program not outputting when backticks are used

I am looking to pass the output from detectUpdateHomeML into a program called insertElement as command line arguments. When I try to use the command ./insertElement `./detectUpdateHomeML` the program detectUpdateHomeML no longer outputs to the…
Colin747
  • 4,955
  • 18
  • 70
  • 118
-4
votes
1 answer

Is it possible to type assert against backticks?

I want to implement logic branching depending on whether the input is a string or a backtick. If it's a string I'll do a simple comparison of the input to an expected value, but if the input is a backtick (e.g. `foo\d{1,3}`) then I want to check my…
Integralist
  • 5,899
  • 5
  • 25
  • 42
-4
votes
2 answers

Bash - back tick invocation blocks for ever

This is most likely a stupid mistake I made somewhere but I just cannot seem to figure out what's happening. Hoping I can find some help here. I have a script callee.sh that expects some optional variable $1,$2,$3 etc... and it does a bunch of echo…
user1763590
  • 117
  • 2
  • 14
-5
votes
2 answers

perl backticks not working for cd. Why?

I'm using AS perl on win7. print `cd \\\\ `; # does nothing, says nothing Same with qx() print `dir \\\\ `; # correctly prints the root directory other commands also seem to work fine. cd works fine from the command line of a batch file. Has…
user1067305
  • 3,233
  • 7
  • 24
  • 29
1 2 3
20
21