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

csh - suppress STDERR when using backticks

I'd like to write a bit of code that looks like this: while ( `ls -1 ${JOB_PREFIX}_${job_counter}_*.out | wc -l` > 0 ) echo "Do something here." end But every time there is no ls -1 ${JOB_PREFIX}_${job_counter}*.csh it gives an annoying ls: No…
Vivek V K
  • 1,100
  • 2
  • 15
  • 33
0
votes
1 answer

bash passing value into command

I have a variable whose value I want to pass into a command. However the $ is producing unusual results. It appears to be acting like an * and searching all directories. My code is: "Please enter the test type: " read…
stevo
  • 171
  • 5
  • 16
0
votes
1 answer

Unicode for single backticks

How can I insert single backticks on ubuntu? this: ` For simple it's like: ' Which unicode exist for simple backticks?
Arch
  • 517
  • 2
  • 7
  • 17
0
votes
1 answer

Catch sql-loader exception while executing sql-loader as command in perl

We are executing sql-loader in perl using command like : `sqlldr $db_arg control=$ctl data=$data log=$log bad=$bad`; But in this way we are unable to find if sql-loader throws any exception. For eg:- even if data has 30,000 records and a problem…
pranjal thakur
  • 312
  • 2
  • 13
0
votes
2 answers

Bash: regular expressions within backticks

I have a file called "align_summary.txt" which looks like this: Left reads: Input : 26410324 Mapped : 21366875 (80.9% of input) of these: 451504 ( 2.1%) have multiple alignments (4372 have >20) ...more text.... ... and…
D. Kazmin
  • 1
  • 2
0
votes
1 answer

Using backtick expression with variable embedded in an rcp command

I need to use a variable within a backtick expression embedded in a rcp invocation. My initial attempt: #!/bin/sh release=1 rcp myserver.foo.com:'`ls -t /path/to/my/${release} | head -n 1`' . I suppose this is failing because the back-tick…
Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
0
votes
4 answers

Why does bash return the file directory when using a back tick?

I'm running this series of commands passwd=`wc -l /etc/passwd` echo $passwd Returns: 34 /etc/passwd What do I need to do to this so that it will only show the output of wc -l?
MRLOBE
  • 3
  • 3
0
votes
2 answers

What do backticked options mean?

I noticed this command: gcc -Wall `libnet-config --defines` libnet-example-x.c -o libnet-example-x `libnet-config --libs` What is the meaning of libnet-config --defines and libnet-config --libs?
why
  • 23,923
  • 29
  • 97
  • 142
0
votes
1 answer

Calling MySQL stored procedures with backticked names using Connector/Python

I'm having trouble using MySQL Connector/Python to call stored procedures with names surrounded by backticks. I get the following syntax error when doing so with the cursor.callproc() method: mysql.connector.errors.ProgrammingError: 1064 (42000):…
0
votes
1 answer

CakePHP: difference between backtick query and normal query

I have 3 blog tables in my CakePHP application that are linked with a HABTM association following the CakePHP naming conventions: posts - post_tag_links - tags. I try to get an array with all the posts that are linked to a specific tag (e.g.…
Sam
  • 472
  • 1
  • 8
  • 19
0
votes
1 answer

Bash for loop: Backticks

I have this code $db=test-1 for T in `mysql -u$dbUser -p$dbPass -N -B -e 'show tables from '$db`; do count=$((count+1)) mysqldump --skip-comments --compact --skip-lock-tables -u$dbUser -p$dbPass $db $T > $GIT_MYSQL/$T.sql done done; It gives me…
rkevx21
  • 2,441
  • 5
  • 19
  • 40
0
votes
0 answers

what is the ` char in JS and how to run it in Internet explorer

I use the ` char for multi lines in JS (especially with document.write) which is very useful. ex: However I don't really understand what it stands for (and worse) it does not work…
yarek
  • 11,278
  • 30
  • 120
  • 219
0
votes
0 answers

Shell argument expansion when passing with backticks

Executing this command gives the expected output - the "c d" is handled as a single argument: % /bin/sh -c 'args="$@"; for a in "$@"; do echo $a; done' -- a b "c d" a b c d If the same argument is stored in a file and passed to script by cat, I got…
Walter X
  • 11
  • 4
0
votes
1 answer

perl using backticks times out

I have a problem I am hoping someone can help with I am running a perl script that calls a python script with a set of arguments as below my $outText=`sudo /usr/bin/python /usr/local/bin/tacms/scriptname.py $pNumber $crnNumber` The scriptname is…
0
votes
1 answer

Escaping Special Characters in Import for Neo4j

In my where clause I am trying to escape a special character "#" by following the manual's recommendation regarding backticks when creating a node: WHERE line.`The #` IS NOT NULL AND line.`Person's First/Last Name` IS NOT NULL However, when I do…
NumenorForLife
  • 1,736
  • 8
  • 27
  • 55