javey javey - 4 months ago 28
Bash Question

Sub command line after typing \ or ` in Linux

What is the sub input terminal that shows up when I type the character \ or ` (backtick) into a Linux command line? It shows up with what I assume is a prompt that contains a single ">" character. (see image below)

It almost appears to be a scripting terminal (like python's ">>>").

enter image description here

I tried asking google but the question is hard to explain.

Answer

It is just waiting for a closing backtick.

You can get the output from a commando using those backticks and assign it to a variable. If you would do myvar=`ls`, then the output of ls would be assigned to myvar.

You can use myvar=$(ls) likewise, and some suggest it is even more modern.