Most shells will issue $PS2 as the continuation prompt if you quote a filename and try to insert a carriage return.
Ctrl-V Ctrl-J is the explicit keypress pair to insert a carriage return without triggering $PS2, but beware: If the carriage return is outside of quotes, that’s equivalent to starting a new command in much the same way a semicolon or a new line in a shell script would.
echo"hello^V^Jthere" [Enter] echoes hello on one line and then there on the next, but echo hello^V^Jthere [Enter] will echo hello then try to run a command called there
We’d have to assume that whatever fixes spaces in filenames would also have an option to fix this subtlety. And I say to whoever tries: Good luck with that.
Most shells will issue
$PS2as the continuation prompt if you quote a filename and try to insert a carriage return.Ctrl-V Ctrl-J is the explicit keypress pair to insert a carriage return without triggering
$PS2, but beware: If the carriage return is outside of quotes, that’s equivalent to starting a new command in much the same way a semicolon or a new line in a shell script would.echo "hello^V^Jthere"[Enter] echoeshelloon one line and thenthereon the next, butecho hello^V^Jthere[Enter] will echohellothen try to run a command calledthereWe’d have to assume that whatever fixes spaces in filenames would also have an option to fix this subtlety. And I say to whoever tries: Good luck with that.