liljencrantz / crush

Crush is a command line shell that is also a powerful modern programming language.
MIT License
1.84k stars 35 forks source link

Never use > as a prompt #12

Closed voederbietel closed 4 years ago

voederbietel commented 4 years ago

Ancient sysadmin wisdom: don’t use ‘>’ as part of your shell prompt. You’re one copy/paste error away from truncating a file.

There’s a reason root’s ‘#’ prompt gets interpreted as a comment. https://twitter.com/QuinnyPig/status/1291411065608208384?s=20

Can the default prompt be changed?

liljencrantz commented 4 years ago

I absolutely see what you're saying in normal shell languages that uses < and > for IO redirection, but since crush generally uses typed data, you use commands like json:from my_file.josn to read files. The < and > symbols are the comparison operators in Crush.

There is still some benefit to making copy-and-paste with a prompt automatically make things a comment though.

liljencrantz commented 4 years ago

Fixed in https://github.com/liljencrantz/crush/commit/9d417582ec23d33b64aa2180028b5718b7ca6606

voederbietel commented 4 years ago

Thanks for the quick fix