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

backticks `cat filename` failed, file content is several commands

My system is CentOS 6.5 When I want to use backtick to run the commands in filename, i got the result below: the file's content is below: [liu-uil@~ 15:54:16]$cat test echo 1; echo 2; echo 3; [liu-uil@~ 15:54:18]$`cat test` 1; echo 2; echo…
liu
  • 37
  • 5
1
vote
1 answer

MySQL error involving backticks

I'm having some problems with this piece of mySQL code that is not wanting to get fixed CREATE TABLE `DatabaseMGR` ( `databaseID` INT UNSIGNED NOT NULL AUTO_INCREMENT, `primCat` INT UNSIGNED NOT NULL, `databaseName` VARCHAR(20), …
FDaniels
  • 23
  • 7
1
vote
2 answers

How to apply the same command to a list of files in Bash?

I mean some command subtitutions. In the past I was able to use backticks in Bash, when for example I had to download a list of files / links which had been already collected in a text file, line by line: wget `cat list.txt` and even megadl to…
Konstantin
  • 2,983
  • 3
  • 33
  • 55
1
vote
3 answers

In Python 2.x, using backticks to get decimal string from int object is Horrible?

In Python 2.x, using backticks to get decimal string from int object is Horrible? Because backticks are repr(), not str()? I have noticed that when I answering this question. In Python source, they have same function in Python source,…
YOU
  • 120,166
  • 34
  • 186
  • 219
1
vote
1 answer

Python: How to use backticks in subprocess?

I would like to run a subprocess from Python. Inside the command string are several subcommands with backticks: subprocess = subprocess.Popen( [ "echo", "COMMAND [`date +%%s`] SCHEDULE_HOST_DOWNTIME;%s;`date +%%s`;`date -d 'now +…
udondan
  • 57,263
  • 20
  • 190
  • 175
1
vote
2 answers

PHP - "git pull" gives no output on backtick

I have the following code
Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189
1
vote
1 answer

change working directory from csh script

I want to lookup some data of running processes, actually I'm searching for the scratch directory to a corresponding job-ID. I managed to do that manually by the following commands (assuming the job-ID is 12345): find ~ -name '12345.out' This finds…
tmartin
  • 311
  • 5
  • 15
1
vote
2 answers

Clojure backtick expansion

According to the Learning Clojure wikibook backticks are expanded as follows `(x1 x2 x3 ... xn) is interpreted to mean (clojure.core/seq (clojure.core/concat |x1| |x2| |x3| ... |xn|)) Why wrap concat with seq? What difference does it make?
Matthew Molloy
  • 1,166
  • 1
  • 10
  • 22
1
vote
1 answer

Using backtick command execution in Git alias

Here's a simple example to demonstrate my problem. If I do: git commit -m "`date --utc`" It executes date --utc, and puts the result inside the commit message. However, when I alias it to testcomit: git config --global alias.testcommit 'commit -m…
Saeb Amini
  • 23,054
  • 9
  • 78
  • 76
1
vote
1 answer

brace expansion command not recognized

How can I repeat a shell command using brace expansion (or another simple method), adjusting certain parameters for each iteration of the command? Here's a simple example of what I'd like to do (but with more lengthy commands): cp a b; cp a…
mike
  • 219
  • 2
  • 9
1
vote
1 answer

Error while executing a shell command using backtick in ruby

I am executing a command to find out number of files in a folder recursively. There are other processes which keep putting files in to this folder. Example command: ls -1 -rt /dump > /segmentizer.out 2> /segmentizer.err Sometimes it is returning…
ananthram
  • 11
  • 1
1
vote
2 answers

Object reference not set to an instance of an object. Did not convert

I have a perl program hosted on a windows 7, which is being called by a publishing framework hosted on a linux environment. This publishing framework has a Java based interface which calls the configured script (perl program calling external…
Ranjan
  • 11
  • 2
1
vote
1 answer

doxygen: how to output backticks in a code section

i was wondering if it is possible to output backticks whithin a doxygen' code section. ~~~~~~~~~~ for file in `ls dir/*.filter` do done ~~~~~~~~~~ I get no output at all. And this seems to be caused by the backtick "`" i've inserted…
mbelaoucha
  • 85
  • 6
1
vote
3 answers

Is it possible to execute a Python program between backticks in a shell command?

I'm trying to execute a Python program, redirect its output to a file, and compare the contents of that file to an existing one, all in a single shell command. This is what I have, but of course it's not working: diff `python3 program.py >…
Tyler
  • 2,579
  • 2
  • 22
  • 32
1
vote
1 answer

Bash script: spawning multiple processes issues

So i am writing a script to call a process 365 times and they should run in 10 batches, so this is something i wrote but there are multiple issues - 1. the log message is not getting written to the log file, i see the error message in err file 2.…