Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: convolutions



On 11/06/2015 09:37 PM, Mikael Magnusson wrote:
A smart thing to include when asking for a simpler way to do an obfuscated thing is what it is you're actually trying to do. Saves people the effort of trying to deobfuscate your code first. It's also super unclear what you mean by "expanding $red into native".

... expanding color variables, eg. " ${red} " into their native " \e[31;1m " in a file.

That isn't clear? Variables holding color codes seem like a very routine thing  to me, there are many of them as a standard part of the shell. If you have some long string with color variables ( eg. "$_red" ) in it, and you echo the string, the colors execute, but if you save that same string to a file and 'cat' it, the color variables do not expand--it is necessary to convert them to the actual escape codes. My code snippet does that, I'm just wondering if it's as simple as it can be.



Messages sorted by: Reverse Date, Date, Thread, Author