ASCII art in the BASH world

Posted by: drakino

ASCII art in the BASH world - 10/10/2003 14:15

Someone made a really cool ASCII art image for my new Powerbook that I want to display when I open up a new terminal. Easy emough, I put the art into a file, then just have .profile run cat asciiart. Now here is the challenge. I want to add color to it, and so far I have not had much luck. I found bash has echo -e to allow ANSI escape sequences, but converting the art into bash echo statements is proving difficult. So many of the characters used are being picked up, resulting in messes like:
./test: command substitution: line 1: syntax error near unexpected token `}'

./test: command substitution: line 1: ` } } '
./test: -: command not found
; / , -.___ \| \|_) \| ___ ___ \| \| _ / /~
./test: ,: command not found
./test: |/: No such file or directory
./test: ~.___,---}: command not found
./test: -,: command not found


Any useful web pages out there to show what I need to escape out in these echo commands? I haven't come across anything useful searching for the past half hour.

Thanks
Posted by: drakino

Re: ASCII art in the BASH world - 10/10/2003 14:21

/me engages tfabris post mode

Aha, got quite a bit closer using single quotes on the echo commands instead of double quotes. I just have 4 lines to fix now.
Posted by: wfaulk

Re: ASCII art in the BASH world - 10/10/2003 14:25

Or you could just embed the escape sequences in the file itself and continue to cat it.
Posted by: drakino

Re: ASCII art in the BASH world - 10/10/2003 14:39

Or you could just embed the escape sequences in the file itself and continue to cat it.
How? When I put the escape sequences of \033[34m , it simply spits it out to the console.
Posted by: wfaulk

Re: ASCII art in the BASH world - 10/10/2003 14:52

Did you put the four character string \033 or the single character 033/0x1B?
Posted by: drakino

Re: ASCII art in the BASH world - 10/10/2003 15:13

I put the string \033. Let me look up the command on this OS X machine to put it in as a single character.
Posted by: drakino

Re: ASCII art in the BASH world - 10/10/2003 16:12

Finally just game up and instead still made it an echo sequence, replacing all the characters with the escape code equivelents.

Posted by: mlord

Re: ASCII art in the BASH world - 10/10/2003 17:16

very pretty!
Posted by: wfaulk

Re: ASCII art in the BASH world - 10/10/2003 17:26

Let me look up the command on this OS X machine to put it in as a single character.
I'd just use vi where it should just be <Ctrl-V><Esc>.
Posted by: canuckInOR

Re: ASCII art in the BASH world - 10/10/2003 23:29

Trogdor!
Posted by: Anonymous

Re: ASCII art in the BASH world - 11/10/2003 05:00

it looks like you got it to work on the 666th try. coincidence?
Posted by: wfaulk

Re: ASCII art in the BASH world - 11/10/2003 09:59

I really like that arm ... coming out of the back of his neck there.
Posted by: Anonymous

Re: ASCII art in the BASH world - 11/10/2003 15:33

www.homestarrunner.com/sbemail58.html