3 ms·
> I strongly recommend against putting a ">" in your prompt on Unix ... Another reason against using ">" in the definition of PS1 is that this is a typical cha
by AdieuToLogic 1y ago
> I strongly recommend against putting a ">" in your prompt on Unix ...
Another reason against using ">" in the definition of PS1 is that this is a typical character used in the definition of PS2[0].
> The :; has the advantage that, if you unintentionally include the prompt in your copy and paste, it usually has no effect.
This is because colon (':') has a specific definition in POSIX shells[1], which is:
Do nothing beyond expanding arguments and performing
redirections. The return status is zero.
Note that "performing redirections" can result in destructive file operations.
0 - https://unix.stackexchange.com/questions/193659/in-which-situations-are-ps2-ps3-ps4-used-as-the-prompt https://unix.stackexchange.com/questions/193659/in-which-sit...
1 - https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html https://www.gnu.org/software/bash/manual/html_node/Bourne-Sh...
- kragen 1y agoRight, I shouldn't assume that everyone knows what the `:` command does. I'm not especially worried about destructive file operations in this context because I don't think any of my directories has a `>` in its filename.