3 ms·
Eh, depends on context, for bash scripts that might be just fine. You need to have some styling information go along with it anyways, so instead of having some
by iforgotpassword 6y ago
Eh, depends on context, for bash scripts that might be just fine. You need to have some styling information go along with it anyways, so instead of having some dedicated markup language and then having an output library that converts that to whatever your output uses, you could just declare those ansi escape codes your "markup language" and should you ever need to output it to something else, say a web page, I'm sure there's code around that does the conversion. But I guess to make it more readable you might want to put those commonly used sequences into some variables so you can do
echo "${esc_red}ERROR${esc_reset}: All messed up"
- db48x 6y agoAt least call tput or something so that your script doesn't do anything wacky just because you SSH'd in this time instead of using your customary terminal.
- klodolph 6y agoFor advanced features, sure. But basic colors are nearly universal.
- db48x 6y agoUntil someone runs it in eshell, which is a shell but not a terminal emulator and you have to configure an override just for that special program so that it isn't dumping unreadable garbage into the buffer.
- klodolph 6y agoHonestly, since eshell is the only example I can think of, I’d say that it’s more than fair to consider this a flaw in eshell.