backticks before bash command in shell
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
What is the meaning of backticks before the bash command in the following manner?
```bash
# Or
`bash
When I enter the following commands on my shell the following prompt
appears
>
But if I enter
``bash
The >
doesn't appear.
I came across this when following build-unix.md instructions for the bitcoin source code v0.15.1 in my text editor.
https://github.com/bitcoin/bitcoin/blob/v0.15.1/doc/build-unix.md
```bash
BITCOIN_ROOT=$(pwd)
Thanks for your insights
bash
add a comment |Â
up vote
2
down vote
favorite
What is the meaning of backticks before the bash command in the following manner?
```bash
# Or
`bash
When I enter the following commands on my shell the following prompt
appears
>
But if I enter
``bash
The >
doesn't appear.
I came across this when following build-unix.md instructions for the bitcoin source code v0.15.1 in my text editor.
https://github.com/bitcoin/bitcoin/blob/v0.15.1/doc/build-unix.md
```bash
BITCOIN_ROOT=$(pwd)
Thanks for your insights
bash
There are no double backticks shown on (the formatted version of) that webpage. (Also, noBITCOIN_ROOT=$(pwd)
.) So which page are you really referencing?
â roaima
Mar 7 at 8:50
Ah. Your version of the software seems to be at least a year old. I would strongly suggest you get the current version instead of 0.13.
â roaima
Mar 7 at 8:58
@roaima I was reading the document from my text editor, not the webpage which is why I was shown the GitHub markdown language backticks. I edited my answer to make that more clear. I was referencening the v0.15.1 tag, I have the right software. Thanks!
â HamsterDancer
Mar 7 at 17:57
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
What is the meaning of backticks before the bash command in the following manner?
```bash
# Or
`bash
When I enter the following commands on my shell the following prompt
appears
>
But if I enter
``bash
The >
doesn't appear.
I came across this when following build-unix.md instructions for the bitcoin source code v0.15.1 in my text editor.
https://github.com/bitcoin/bitcoin/blob/v0.15.1/doc/build-unix.md
```bash
BITCOIN_ROOT=$(pwd)
Thanks for your insights
bash
What is the meaning of backticks before the bash command in the following manner?
```bash
# Or
`bash
When I enter the following commands on my shell the following prompt
appears
>
But if I enter
``bash
The >
doesn't appear.
I came across this when following build-unix.md instructions for the bitcoin source code v0.15.1 in my text editor.
https://github.com/bitcoin/bitcoin/blob/v0.15.1/doc/build-unix.md
```bash
BITCOIN_ROOT=$(pwd)
Thanks for your insights
bash
edited Mar 7 at 17:48
asked Mar 6 at 23:35
HamsterDancer
185
185
There are no double backticks shown on (the formatted version of) that webpage. (Also, noBITCOIN_ROOT=$(pwd)
.) So which page are you really referencing?
â roaima
Mar 7 at 8:50
Ah. Your version of the software seems to be at least a year old. I would strongly suggest you get the current version instead of 0.13.
â roaima
Mar 7 at 8:58
@roaima I was reading the document from my text editor, not the webpage which is why I was shown the GitHub markdown language backticks. I edited my answer to make that more clear. I was referencening the v0.15.1 tag, I have the right software. Thanks!
â HamsterDancer
Mar 7 at 17:57
add a comment |Â
There are no double backticks shown on (the formatted version of) that webpage. (Also, noBITCOIN_ROOT=$(pwd)
.) So which page are you really referencing?
â roaima
Mar 7 at 8:50
Ah. Your version of the software seems to be at least a year old. I would strongly suggest you get the current version instead of 0.13.
â roaima
Mar 7 at 8:58
@roaima I was reading the document from my text editor, not the webpage which is why I was shown the GitHub markdown language backticks. I edited my answer to make that more clear. I was referencening the v0.15.1 tag, I have the right software. Thanks!
â HamsterDancer
Mar 7 at 17:57
There are no double backticks shown on (the formatted version of) that webpage. (Also, no
BITCOIN_ROOT=$(pwd)
.) So which page are you really referencing?â roaima
Mar 7 at 8:50
There are no double backticks shown on (the formatted version of) that webpage. (Also, no
BITCOIN_ROOT=$(pwd)
.) So which page are you really referencing?â roaima
Mar 7 at 8:50
Ah. Your version of the software seems to be at least a year old. I would strongly suggest you get the current version instead of 0.13.
â roaima
Mar 7 at 8:58
Ah. Your version of the software seems to be at least a year old. I would strongly suggest you get the current version instead of 0.13.
â roaima
Mar 7 at 8:58
@roaima I was reading the document from my text editor, not the webpage which is why I was shown the GitHub markdown language backticks. I edited my answer to make that more clear. I was referencening the v0.15.1 tag, I have the right software. Thanks!
â HamsterDancer
Mar 7 at 17:57
@roaima I was reading the document from my text editor, not the webpage which is why I was shown the GitHub markdown language backticks. I edited my answer to make that more clear. I was referencening the v0.15.1 tag, I have the right software. Thanks!
â HamsterDancer
Mar 7 at 17:57
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
This is from github markdown language. This should not be copied into your terminal. In order to make a codeblock in github you surround your code with three backticks like so:
```
code
goes
here
```
In order to add syntax highlighting, you can specify the language like so:
```bash
code
goes
here
```
The code you want will be the stuff between the backticks.
The reason you are seeing the >
prompt is because in bash the backticks are a special character used for command substitution. (It's an outdated way to do it but still works).
You can use it like:
$ echo `hostname`
it should be done like this
$ echo "$(hostname)"
Which will echo the hostname of your machine.
However when bash sees one backtick it interprets the rest of the statement as command substitution until it reaches a closing backtick. When you have three the first two close each other but the third opens opens a new substitution statement and bash is looking for a closing backtick. When you hit enter it displays a >
to let you know you are still inside this block and allow you to enter multi-line commands. The same happens with quotes or the line escape character:
$ echo `
> hostname
> uname -s
> `
JBCGENS001 Linux
$ echo '
> hello
> world
> '
hello
world
$ echo
> hello
> world
hello world
Thanks for clearing that up! Would you also happen to know why I'm getting the > symbol after entering that input and what it means ?
â HamsterDancer
Mar 7 at 0:01
@HamsterDancer: I have updated my question
â Jesse_b
Mar 7 at 0:13
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
This is from github markdown language. This should not be copied into your terminal. In order to make a codeblock in github you surround your code with three backticks like so:
```
code
goes
here
```
In order to add syntax highlighting, you can specify the language like so:
```bash
code
goes
here
```
The code you want will be the stuff between the backticks.
The reason you are seeing the >
prompt is because in bash the backticks are a special character used for command substitution. (It's an outdated way to do it but still works).
You can use it like:
$ echo `hostname`
it should be done like this
$ echo "$(hostname)"
Which will echo the hostname of your machine.
However when bash sees one backtick it interprets the rest of the statement as command substitution until it reaches a closing backtick. When you have three the first two close each other but the third opens opens a new substitution statement and bash is looking for a closing backtick. When you hit enter it displays a >
to let you know you are still inside this block and allow you to enter multi-line commands. The same happens with quotes or the line escape character:
$ echo `
> hostname
> uname -s
> `
JBCGENS001 Linux
$ echo '
> hello
> world
> '
hello
world
$ echo
> hello
> world
hello world
Thanks for clearing that up! Would you also happen to know why I'm getting the > symbol after entering that input and what it means ?
â HamsterDancer
Mar 7 at 0:01
@HamsterDancer: I have updated my question
â Jesse_b
Mar 7 at 0:13
add a comment |Â
up vote
6
down vote
accepted
This is from github markdown language. This should not be copied into your terminal. In order to make a codeblock in github you surround your code with three backticks like so:
```
code
goes
here
```
In order to add syntax highlighting, you can specify the language like so:
```bash
code
goes
here
```
The code you want will be the stuff between the backticks.
The reason you are seeing the >
prompt is because in bash the backticks are a special character used for command substitution. (It's an outdated way to do it but still works).
You can use it like:
$ echo `hostname`
it should be done like this
$ echo "$(hostname)"
Which will echo the hostname of your machine.
However when bash sees one backtick it interprets the rest of the statement as command substitution until it reaches a closing backtick. When you have three the first two close each other but the third opens opens a new substitution statement and bash is looking for a closing backtick. When you hit enter it displays a >
to let you know you are still inside this block and allow you to enter multi-line commands. The same happens with quotes or the line escape character:
$ echo `
> hostname
> uname -s
> `
JBCGENS001 Linux
$ echo '
> hello
> world
> '
hello
world
$ echo
> hello
> world
hello world
Thanks for clearing that up! Would you also happen to know why I'm getting the > symbol after entering that input and what it means ?
â HamsterDancer
Mar 7 at 0:01
@HamsterDancer: I have updated my question
â Jesse_b
Mar 7 at 0:13
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
This is from github markdown language. This should not be copied into your terminal. In order to make a codeblock in github you surround your code with three backticks like so:
```
code
goes
here
```
In order to add syntax highlighting, you can specify the language like so:
```bash
code
goes
here
```
The code you want will be the stuff between the backticks.
The reason you are seeing the >
prompt is because in bash the backticks are a special character used for command substitution. (It's an outdated way to do it but still works).
You can use it like:
$ echo `hostname`
it should be done like this
$ echo "$(hostname)"
Which will echo the hostname of your machine.
However when bash sees one backtick it interprets the rest of the statement as command substitution until it reaches a closing backtick. When you have three the first two close each other but the third opens opens a new substitution statement and bash is looking for a closing backtick. When you hit enter it displays a >
to let you know you are still inside this block and allow you to enter multi-line commands. The same happens with quotes or the line escape character:
$ echo `
> hostname
> uname -s
> `
JBCGENS001 Linux
$ echo '
> hello
> world
> '
hello
world
$ echo
> hello
> world
hello world
This is from github markdown language. This should not be copied into your terminal. In order to make a codeblock in github you surround your code with three backticks like so:
```
code
goes
here
```
In order to add syntax highlighting, you can specify the language like so:
```bash
code
goes
here
```
The code you want will be the stuff between the backticks.
The reason you are seeing the >
prompt is because in bash the backticks are a special character used for command substitution. (It's an outdated way to do it but still works).
You can use it like:
$ echo `hostname`
it should be done like this
$ echo "$(hostname)"
Which will echo the hostname of your machine.
However when bash sees one backtick it interprets the rest of the statement as command substitution until it reaches a closing backtick. When you have three the first two close each other but the third opens opens a new substitution statement and bash is looking for a closing backtick. When you hit enter it displays a >
to let you know you are still inside this block and allow you to enter multi-line commands. The same happens with quotes or the line escape character:
$ echo `
> hostname
> uname -s
> `
JBCGENS001 Linux
$ echo '
> hello
> world
> '
hello
world
$ echo
> hello
> world
hello world
edited Mar 7 at 0:13
answered Mar 6 at 23:38
Jesse_b
10.4k22658
10.4k22658
Thanks for clearing that up! Would you also happen to know why I'm getting the > symbol after entering that input and what it means ?
â HamsterDancer
Mar 7 at 0:01
@HamsterDancer: I have updated my question
â Jesse_b
Mar 7 at 0:13
add a comment |Â
Thanks for clearing that up! Would you also happen to know why I'm getting the > symbol after entering that input and what it means ?
â HamsterDancer
Mar 7 at 0:01
@HamsterDancer: I have updated my question
â Jesse_b
Mar 7 at 0:13
Thanks for clearing that up! Would you also happen to know why I'm getting the > symbol after entering that input and what it means ?
â HamsterDancer
Mar 7 at 0:01
Thanks for clearing that up! Would you also happen to know why I'm getting the > symbol after entering that input and what it means ?
â HamsterDancer
Mar 7 at 0:01
@HamsterDancer: I have updated my question
â Jesse_b
Mar 7 at 0:13
@HamsterDancer: I have updated my question
â Jesse_b
Mar 7 at 0:13
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f428644%2fbackticks-before-bash-command-in-shell%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
There are no double backticks shown on (the formatted version of) that webpage. (Also, no
BITCOIN_ROOT=$(pwd)
.) So which page are you really referencing?â roaima
Mar 7 at 8:50
Ah. Your version of the software seems to be at least a year old. I would strongly suggest you get the current version instead of 0.13.
â roaima
Mar 7 at 8:58
@roaima I was reading the document from my text editor, not the webpage which is why I was shown the GitHub markdown language backticks. I edited my answer to make that more clear. I was referencening the v0.15.1 tag, I have the right software. Thanks!
â HamsterDancer
Mar 7 at 17:57