backticks before bash command in shell

The name of the pictureThe name of the pictureThe name of the pictureClash 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







share|improve this question






















  • 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














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







share|improve this question






















  • 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












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







share|improve this question














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









share|improve this question













share|improve this question




share|improve this question








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, 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
















  • 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















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










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





share|improve this answer






















  • 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










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















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






























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





share|improve this answer






















  • 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














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





share|improve this answer






















  • 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












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





share|improve this answer














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






share|improve this answer














share|improve this answer



share|improve this answer








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
















  • 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












 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay