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

Using Backtick in Powershell: Unexpected token

In the code below, I am searching through an .ini file and trying to replace certain lines with updated configurations. I've seen it done for single lines, but I am trying to do it for multiple & different lines. When trying to use a backtick, I get…
0
votes
1 answer

Perl backticks not capturing output

I have the following program snippet my $nfdump_command = "nfdump -M /data/nfsen/profiles-data/live/upstream1 -T -R ${syear}/${smonth}/${sday}/nfcapd.${syear}${smonth}${sday}0000:${eyear}/${emonth}/${eday}/nfcapd.${eyear}${emonth}${eday}2355 -n…
SurenNihalani
  • 1,398
  • 2
  • 15
  • 28
0
votes
1 answer

Finding and opening a file with vim in a single command alias in tcsh

I want to make an alias which would work like this: vf hello.c would execute a find command to search for hello.c and open it in the vim editor. What is the best way to do it? I've tried the following (doesn't work): alias vf "find -name $* -exec vi…
TCSGrad
  • 11,898
  • 14
  • 49
  • 70
0
votes
0 answers

R RMySQL not escaping table name, conflicts with MySQL reserved keyword

Code: dbWriteTable(con, name=symbol, value=df, row.names=FALSE, append=TRUE) Error in mysqlExecStatement(conn, statement, ...) : RS-DBI driver: (could not run statement: You have an error in your SQL syntax; check the manual that corresponds to…
ctrlbrk
  • 1,174
  • 2
  • 17
  • 27
0
votes
2 answers

How can I suppress command output when using backticks?

Is there a way to supress the command output for git if I use backticks in my shell script? Here is my current code: OUT=$(git status > /dev/null) Thanks :)
Morph
  • 173
  • 2
  • 5
  • 15
0
votes
1 answer

Redirect output of shell command to perl variable and stdout

I am trying to execute a shell command, and capture its output within perl using backticks, and send the output to STDOUT at the same time, #!/usr/bin/perl use strict; use warnings; my $output = `echo test1 | tee /dev/fd/1`; print "op :…
Jenson Jose
  • 532
  • 2
  • 15
  • 33
0
votes
1 answer

Bash: Execute command with spaces in quotes using backticks

I've written the following bash function. It is supposed to print a command, run it and print its output, and print a short description. #!/bin/bash print_and_run_command() { COMMAND="$1" DESCRIPTION="$2" OUTPUT="`$COMMAND`" printf…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
0
votes
0 answers

PHP printing apostrophe (backticks) and resulting in malformed HTML

I have a string stored in an array: But I Don't and when I print it on my webpage I get: But I Don’t I've tried htmlentities(), htmlspecialchar(), both with ENT_QUOTES enabled. I realize I can force my function to do a string replace each time I…
FaultyJuggler
  • 532
  • 1
  • 8
  • 29
0
votes
2 answers

Perl backticks: flags do not exist

When executing the following segment of code, sub list { my($self)=@_; my $file = $self->{P_Dir}."/".$self->{Name}; print `ls –l $file`; } I get this error: ls: cannot access –l: No such file or directory I am not really sure what is…
fishpen0
  • 619
  • 1
  • 10
  • 23
0
votes
1 answer

character for single quote

(backtick) and ' are two different characters for single quote. I have a mysql script that shows the former two quote characters, if I change them to ', it breaks the syntax. how do I type ` from the keyboard?
user121196
  • 30,032
  • 57
  • 148
  • 198
0
votes
2 answers

Perl backticks when using pipes

I'm experiencing some problems trying to capture the output of a simple command: $timeTotal = `echo $timeTotal + $time | bc -l`; But I'm getting the following errors: sh: +: not found sh: Syntax error: "|" unexpected This command works perfectly…
jarandaf
  • 4,297
  • 6
  • 38
  • 67
0
votes
3 answers

ffmpeg: using the returned data in php

I have started using ffmpeg and I am very new to it, so please bear with me. I have installed ffmpeg on my server and it works great; I can run certain commands and get output data when logged in via ssh For example I can run ffmpeg -i Sleep\…
user1503606
  • 3,872
  • 13
  • 44
  • 78
0
votes
5 answers

backtick not working

I have a large number of files in a directory structure I want to rename. The file names are in this format: "aaaaaa-bbbbbb_cccccc-ddddd_eeeee-fffff-ggggg-hhhhh.psd" I want them in this…
C0ppert0p
  • 634
  • 2
  • 7
  • 23
-1
votes
2 answers

How to intercept multiple backticks notation in OpenAI response

I have written a simple OpenAI based chatbot in JS, but i want to intercept the backticks indicating the language in the chatbot response... in both opening and close I have tried multiple regexes, i came out with the following: fetch(API_URL,…
MrCoder74
  • 40
  • 4
-1
votes
1 answer

Using backticks instead of apostrophes

I am participating in an online program to become a data analyst. I am using SQL to construct queries along with the instruction videos. I feel there is no consistency using SQL regarding the use of backticks and apostrophes. When should I use…
1 2 3
20
21