4 ms·
Nice! I am using some of the funny characters! Some remarks: I doubt if it is needed to launch a sub-process for each markup directive. This is fine for small
by joepvd 11y ago
Nice! I am using some of the funny characters!
Some remarks:
I doubt if it is needed to launch a sub-process for each markup directive. This is fine for small output, but will slow down processing of larger chunks of text. I would be interested in a bash solution based on associative arrays.
As an example, one might want to look at the zsh implementation of the colors script in the main distribution[0], which makes colors available as an associative array:
# Set once in shell init script:
autoload -U colors && colors
# And use it anywhere:
print $fg[blue]hello colorful world!$fg[reset]
[0]: http://sourceforge.net/p/zsh/code/ci/master/tree/Functions/Misc/colors http://sourceforge.net/p/zsh/code/ci/master/tree/Functions/M...