Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#184069 - 10/10/2003 14:15 ASCII art in the BASH world
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
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

Top
#184070 - 10/10/2003 14:21 Re: ASCII art in the BASH world [Re: drakino]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
/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.

Top
#184071 - 10/10/2003 14:25 Re: ASCII art in the BASH world [Re: drakino]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Or you could just embed the escape sequences in the file itself and continue to cat it.
_________________________
Bitt Faulk

Top
#184072 - 10/10/2003 14:39 Re: ASCII art in the BASH world [Re: wfaulk]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
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.

Top
#184073 - 10/10/2003 14:52 Re: ASCII art in the BASH world [Re: drakino]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Did you put the four character string \033 or the single character 033/0x1B?
_________________________
Bitt Faulk

Top
#184074 - 10/10/2003 15:13 Re: ASCII art in the BASH world [Re: wfaulk]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
I put the string \033. Let me look up the command on this OS X machine to put it in as a single character.

Top
#184075 - 10/10/2003 16:12 Re: ASCII art in the BASH world [Re: drakino]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Finally just game up and instead still made it an echo sequence, replacing all the characters with the escape code equivelents.


Top
#184076 - 10/10/2003 17:16 Re: ASCII art in the BASH world [Re: drakino]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14493
Loc: Canada
very pretty!

Top
#184077 - 10/10/2003 17:26 Re: ASCII art in the BASH world [Re: drakino]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
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>.
_________________________
Bitt Faulk

Top
#184078 - 10/10/2003 23:29 Re: ASCII art in the BASH world [Re: drakino]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
Trogdor!

Top
#184079 - 11/10/2003 05:00 Re: ASCII art in the BASH world [Re: drakino]
Anonymous
Unregistered


it looks like you got it to work on the 666th try. coincidence?

Top
#184080 - 11/10/2003 09:59 Re: ASCII art in the BASH world [Re: canuckInOR]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
I really like that arm ... coming out of the back of his neck there.
_________________________
Bitt Faulk

Top
#184081 - 11/10/2003 15:33 Re: ASCII art in the BASH world [Re: wfaulk]
Anonymous
Unregistered



Top