1

Recently, I opened terminal and started typing everything i can, after which i accidentally put " and something like python shell was initialised:

muhammadrasul@AMR:~/Desktop$ lksdflaflakd;kfa;lk"
> a
> s
> 
> fd
> sfs
> fs
>

Then I realised that it works just for " as well. So, what that environment actually is and why does it ignore everything before that "?

ilkkachu
  • 138,973

1 Answers1

3

" starts a string. The string lasts until the next " (except that \" put a " in the string and doesn't end the string). The string can contain newlines. So after entering a single ", the shell keeps reading input, because the string is unfinished.

When you terminate the string with another ", the shell will start executing the command. That's when it will complain that each of the commands is not found.

The > prompt is the shell's way to say that it's expecting more input. You can customize it through the variable PS2, which is analogous to PS1, but for continuation lines.