Sometimes when I type a command in bash, I mistakenly type in the \ character at the end, as it is close to the Enter key.
Whenever I do this, I get a prompt on the next line, like this:
>_
The same output is produced when the ` character is used.
What exactly does this \ do to the command?
Are there other characters (besides \ and `) that give a similar output?
the
\character allows you to break your command into multiple lines :is equivalent to :
the
'and"character allows you to define multiline strings, and the`is a way to use the output of a command as an argument to another.$(command)does the same thing.whenever you see
it means that the command syntax is not complete. Some shell constructs also needs to be terminated, like while, for, if …
The displayed
>can be configured with the PS2 environnement variable.as requested, here is an example using
`:suppose i have a list of files into
filelist.txt:i want to know the number of lines in each of those files. the command would be
wc -l a.c a.h Makefile [...]. to use the output of thecat filelist.txtas arguments to wc -l, i can use :