0

When you open Unix, say in Ubuntu 16.04, you can type \ (the backslash symbol for newcomers) and hit enter, and that will open seemingly some kind of a "sub-prompt" or what I also like to call a "secondary prompt".

I wondered about the differences between the "primary" prompt and this "secondary" one and the only difference I came across (very much by chance) is that the "Secondary" prompt can actually perform a bit longer in-place execution of scripts (given these start with #!/bin/bash), while the "primary" does it and fails after 1-2 seconds. Both will initially fail to fully execute the script, at least if it includes comments, but from some reason the "secondary" will execute significantly more of the script (If I'll paste the script in a script.sh file created with Vi or Nano, it will b executed just fine in the traditional way of ./script.sh).

I want to ask the Unix veterans, what is the formal name of this "sub prompt" if there is one, and what are the main few differences between it and the "primary prompt, if there are indeed any major differences. I ask it here so more people could find this data easily from Google.

1 Answers1

1

The name for secondary prompt is exactly that - secondary prompt. As bash man page gives:

PS2 The value of this parameter is expanded as with PS1 and used as the secondary prompt string. The default is ``> ''.