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

Difference between typing a shell command, and save it to a file and using `cat myfile` to execute it?

I have an rsync command that works as expected when I type it directly into a terminal. The command includes several --include='blah' and --exclude='foo' type arguments. However, if I save that command to a one-line file called "myfile" and I try…
n3utrino
  • 1,160
  • 1
  • 8
  • 16
0
votes
2 answers

Perl regex matching output from `w -hs` command

I'm trying to write a Perl script that will work better with KDE's kwrited, which, as far as I can tell, is connected to a pts and puts every line it receives through the KDE system tray notifications with the title "KDE write…
mmirate
  • 704
  • 6
  • 25
0
votes
1 answer

Ruby - checking ping status featback with ssh, backtick via ssh?

In my project I want to write a script to check if every device in my network is online/reachable. I have a method called pingtest and it works for now.. def pingtest(destination) system("ping -n 2 #{destination}") if $? == 0 …
Drayke
  • 367
  • 1
  • 3
  • 14
0
votes
1 answer

Why does backticks fails in PDO query?

I have a table with hyphens in the name, and I can't change the table name so I thought backticks would help. Unfortunally for me it failed, some googling did'nt give me any answers. How can I solve this? ex: $stmt = $this->_dbh->prepare( …
Jorgeuos
  • 541
  • 6
  • 28
0
votes
3 answers

Perl - stop error appearing in command line output

What I am doing: I have the following backticks command that executes in a simple foreach loop and saves the command output to a variable and I then perform string matching actions on that variable: $ciphertestoutput = `echo -n | openssl s_client…
yonetpkbji
  • 1,019
  • 2
  • 21
  • 35
0
votes
1 answer

Strawberry perl: need to use ampersand in a backtick command as a parameter, not as background

I am trying to get a "wget" post command to run from a perl script. I'm using strawberry perl on a Windows 7 machine. The post parameter includes ampersand (&) characters and when I run the wget inside of a backtick, the ampersand is treated like…
sjmyst
  • 1
  • 1
0
votes
1 answer

perl command line backticks with matrix

I'd like to transfer a matrix from one perl file to another by using a command line with backticks. On the first file perl, source.pl : use warnings; use strict; my @matrix = ( [1, 2, 3], [4, 5, 6], [7, 8, 9] ); my $results = `perl…
Poub
  • 13
  • 3
0
votes
3 answers

Bash insert a variable into a backticked command

I need to use this command /usr/local/bin/mcl find -f .bz2 which returns me this :???????? '/Cloud Drive/test1.bz2' :???????? '/Cloud Drive/test2.bz2' into a BASH script. The problem is that I need the last parameter (.bz2) to be a variable. I've…
ToX 82
  • 1,064
  • 12
  • 35
0
votes
2 answers

MySQL grouping by a previously declared alias, what do I wrap it in? ' OR `

I have an SQL query that has an alias in the SELECT statement SELECT CONCAT(YEAR(r.Date),_utf8'-',_utf8'Q',QUARTER(r.Date)) AS 'QuarterYear' Later, I want to refer to this in my group by statement. I'm a little confused...should I wrap this with…
0
votes
2 answers

Ruby, using backticks to grep file extensions and searching file content for a string

I'm trying to locate txt and html files that contains "some string user input" in their contents. in the command line the following command works perfect. grep -ri --include \*.txt --include \*.html string . but when trying to code it into ruby…
fizz
  • 3
  • 2
0
votes
0 answers

ruby backticks redirection error

whenever I try irb(main):008:0> `while read FILENAME; do echo "Hi";done < <(cat /tmp/a)` I get the following error: sh: 1: Syntax error: redirection unexpected Is there anyway to bypass this issue, but still use back ticks for the shell exec from…
meso_2600
  • 1,940
  • 5
  • 25
  • 50
0
votes
1 answer

How to add a null condition in CodeIgniter without quotes?

This code: $this->db->where('id_etablissement_commanditaire IS ', $_POST['id_etablissement_commanditaire'], FALSE ); Gives: WHERE id_etablissement_commanditaire IS NULL That one: $this->db->where('id_etablissement_commanditaire IS ',…
Nils BAY
  • 35
  • 1
  • 7
0
votes
1 answer

STDOUT from Pidgin plugin script

Yesterday, I wrote a perl plugin script for Pidgin 2.10.9, running on Windows 7, and using Strawberry Perl 5.10.1.5 Basically, on the receipt of an IM, it uses backticks to call a console application (written in .NET) and returns the console output…
Marq Watkin
  • 140
  • 1
  • 1
  • 6
0
votes
1 answer

Compiling GTK-app cmd-windows with backticks

According to a tutorial on https://developer.gnome.org/gtk-tutorial/stable/c39.html for making GUI for c-apps the compiling syntax is gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0` Its all about these backticksymbols and seem to be suited…
Björn Hallström
  • 3,775
  • 9
  • 39
  • 50
0
votes
1 answer

MySQL not able to use backtick for reserved keyword

I'm creating a simple table and i'm not able to use the reserved keyword Password. I tried using backticks, but get an error "Msg 102, Level 15, State 1, Line 7 Incorrect syntax near '`'." I don't wanna use double quotes, can someone please tell…
rbk
  • 283
  • 2
  • 3
  • 16