Ask Your Question
0

What does ` mean in Linux bash?

asked 2016-03-26 23:16:55 -0500

Y guy gravatar image

It is hard or impossible to google `

But it must be a builtin, a function or some active content.

As you would expect, help ` in bash yields > which is not of much help.

Very cryptic and not user-friendly.

Which leads to another question: what happened after entering help ` (real backtick)? What does the > prompt signify or mean?

edit retag flag offensive close merge delete

Comments

backtick is also known as accent-grave in French, though not as a singular character, but as a diacritical sign.

Y guy gravatar imageY guy ( 2016-03-28 02:14:54 -0500 )edit

This is not an OpenStack related question. Please, post this kind of questions to serverfault or any other similar forum. Regards

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2016-03-28 11:54:47 -0500 )edit

sorry. I thought that "Openstack" was "Stack Overflow". My mistake. ;-)

' > ' ist the $PS2 or $PS3 select prompt variable content. see ´ help select ´ for more info.

Y guy gravatar imageY guy ( 2016-03-29 03:36:49 -0500 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2016-03-26 23:14:12 -0500

Y guy gravatar image

updated 2016-03-28 02:15:56 -0500

Indeed ` cannot be googled. But wikipedia has something:

3.4.5. Command substitution with backticks `

Command substitution allows the output of a command to replace the command itself. Command substitution occurs when a command is enclosed like this:

$(command)

or like this using backticks: (the ´ backticks disappear in this web editor command making this topic very hard to discuss). In openstack you cannot discuss backticks since their editor uses them as formatting controls.

'command' (imagine those were actual backticks or accent-grave thingys)

Bash performs the expansion by executing COMMAND and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting.

franky ~> echo date Thu Feb 6 10:06:20 CET 2003

When the old-style backquoted form of substitution is used, backslash retains its literal meaning except when followed by "$", "`", or "\". The first backticks not preceded by a backslash terminates the command substitution. When using the "$(COMMAND)" form, all characters between the parentheses make up the command; none are treated specially.

Command substitutions may be nested. To nest when using the backquoted form, escape the inner backticks with backslashes.

If the substitution appears within double quotes, word splitting and file name expansion are not performed on the results.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-03-26 18:58:55 -0500

Seen: 85 times

Last updated: Mar 28 '16