Help With Toilet App Please

Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
I posted the following message in several other places online, but I wanted to post it here as well, just in case someone here can assist me.

Recently, I have been discovering some very cool command line ASCII and ANSI tools, such as jp2a, imagemagick, libcaca and toilet.

Unless you are into ASCII and ANSI graphics, and are involved in running a BBS, these little programs will probably be of little interest to you.

However, if you are knowledgeable of such things, right now I am having a problem figuring out how to export an ANSI graphic from toilet to a text file on my hard drive. I can't figure out if the file is even being created, and if so, where it is being exported to on my hard drive. According to one Debian user on the mewbies.com website, the graphic should be exported to the "working directory", which in the case of a Mac OS X user, I assume means the Home folder. However, I see nothing being created there.

If you are familiar with toilet, please let me know. I have looked at the man page, but while it briefly discusses the --export parameter, it does not specifically say where the graphic is exported to on an OS X machine.

Thanks in advance.
 
Last edited by a moderator:
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
Hello cradom. Thanks for your response. You are in fact the first person to respond in all of the various places where I posted my message a few hours ago.

First, it appears from your comment that you are on Ubuntu. I, in turn, am working in the Mac OSX terminal app under Yosemite. Thus, I am wondering if toilet functions exactly the same, or even uses the same commands and parameters.

More specifically, you appear to be saying that I need to actually designate a file name and extension. However, in the man page for the version of toilet that I installed under Mac OS X, there is no mention of adding a file name to the command.

Thus, I have tried both of the following examples, but without positive results:

toilet --export ansi --font bigascii12 -F gay "THANKS"

toilet --font bigascii12 -F gay "THANKS" --export ansi

In other words, I get the correct on-screen -- or in-terminal, if you prefer -- output. However, I just don't know where it is being exported to, if it is being exported at all.

I assume that it is, because the terminal is not throwing me any error messages.

Any ideas?

Thanks!
 
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
Cradom, I just looked at that man page for toilet for Ubuntu that you provided. It looks exactly the same as what I was already reading earlier today, and in fact saved to my hard drive. The in-line manual has about the same info, and a little more.

So where are you getting that ">output.txt" from?

I realize that "output.txt" is just an example, but where does the ">" part of the command line come into the picture? I don't see anything like that referenced in the man page? Is that perhaps an Ubuntu-native command, perhaps?

Yes, I am very much a newbie at some of this stuff. I am not exactly a Terminal geek, though I will use it when I have to. :)

Thanks!
 
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
Ha! Oh gosh!

Forget my previous two responses.

I added the ">output.txt" to the command line, and it works now!

Yippee! Thanks buddy!

So why don't they mention that important piece of info on the man page??? ;P
 
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
You know, one thing I just noticed though when looking at the output text is that it is seriously redundant.

What I mean is this. For every single color switch, it is like this, for example:

<-[0;1;33m

The entire output is in bold colors, so there is no need to turn off bold, and then turn it on again for each color switch.

In fact, in the empty spaces between the characters and color switches, it also repeatedly has this:

<-[0;37;40

Again, very unnecessary.

All the output needs is ONE bold code, with one black background code at the very beginning of the file, and both will be carried through to the end of the file for all characters and foreground colors concerned.

Anyway, I cleaned up the code, and it looks a lot nicer, and is easier to read.

But again, thanks so much for your help. Your response was right on spot, even if I did not understand it at first.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
1. Nope, not Ubuntu, Yosemite. That's the first link i came across.

2. Most if not all commands output to the screen. If you want the output to go somewhere else you need to redirect it.
To do this use the > operator. This redirects the standard output to some other place such as a file or other device.
The standard error output can be redirected using >>.
The -export switch is only for the format of the output, text, HTML, etc. To get an actual file, redirect.

3. This morning is the first I've heard of this particular command. I don't know why they wrote it like that, probably to facilitate error checking and possibly to make editing the file easier. I've forgotten anything I ever knew about escape codes. That's what Google is for.

Good to see someone is still implementing old BBS code. I might sign up and check it out myself. Luck.
 
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
Are you saying that until this morning, you had never heard of the ">" redirect command either? If so, interesting, and right on time to help me out.

You know, I had already given up trying to get the export to work properly. So what I did was export the Terminal window itself, which of course was simply black text on a white background. So there I was slowly adding all of the ANSI codes, based on what I was seeing in the Terminal.

That is when you came to the rescue and saved me some time.

Oh yes. Hermes II is close to 30 years old, but it will still run in Classic mode if you use SheepShaver or Basilisk II. That is how I run both my BBS and my old Hotline server.

Please do stop by the BBS when you feel so led. Today was in fact a rather interesting day in another way as well. As few BBSers -- and particularly Mac BBSers -- that remain, today for the first time ever, we actually had three of us in a three-way chat. That has never happened before in all the years that I ran my BBS, since 1994. So maybe there is hope yet for Macintosh-based BBSing.

One other final interesting development: There are several OS X BBS packages in the works. I have been to the developer boards of both of them during the past few days, but neither is ready for prime time yet, and they have both been in development for a number of years.

Until they are ready for prime time, with all normal BBS features and then some, I guess I will continue with Hermes II, despite how archaic it is in some ways.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
No. Output redirecting is a basic part of Bash, csh, tcsh or any other *nix shell.
This is the first I've heard of toilet. (and no bad jokes either :p )
I cant believe you're running Hotline. Remember Carracho? Does anyone still use those?
 
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
Well, it is kind of funny, actually, because yesterday I installed both libcaca and toilet. I also installed Homebrew. Then today we had to resolve an issue regarding PuTTY users on my BBS.

So between drinking that old homebrew, and having to go caca in the toilet, it really makes one feel like putty. :) :)

Seriously, I did install all of those. I already had MacPorts installed, but installing Homebrew simplified installing the others.

There are a lot of neat little programs hiding in the command line interface, and these ASCII / ANSI ones are kind of cool if you are a BBS SysOp.

Yes, I ran Hotline for at least eight consecutive years, as well as Carracho for a bit, and KDX too. In fact, I made a pile of icon sets and themes for KDX years ago. I mean like a lot. Then I worked on a tweaked version of Hotline which I called FreeShare. I had my stuff on MacUpdate, Softpedia and Tucows for a while.

But as I said, just last month I put up my BBS and Hotline server again using SheepShaver, and it has been rather interesting. There is still somewhat of an interest out there for some people.
 
Joined
Jul 30, 2009
Messages
7,297
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
Hello cradom. Thanks for your response. You are in fact the first person to respond in all of the various places where I posted my message a few hours ago.

Glad you were able to flush out a response.

Yeah, I know, too obvious; but I couldn't resist. :Evil:
 
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
Oh gosh . . . now look what I have started . . . toilet jokes! :p

Actually, as I mentioned above, I can see why they may have decided to call the app "toilet". It does in fact generate a lot of crap -- unnecessary and redundant code -- when it creates the output file.
 
Last edited:
Joined
Jul 30, 2009
Messages
7,297
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
Can't you wipe that output file clean?
 
OP
HermesSysOp
Joined
Mar 13, 2015
Messages
14
Reaction score
0
Points
1
Location
Guam
Your Mac's Specs
Retina 5K 27-inch 2017 iMac
I'm sorry, but I don't quite understand what you mean by "wipe that output file clean."

Are you referring to the fact that toilet adds a lot of redundant ANSI codes to the output file? If so, the only solution is to remove it all manually, either by using search and replace in a text editor, or simply by painstakingly removing each instance of unnecessary code.

Each time that you export from toilet, it creates a brand new file, unless you make a brand new graphic, and give it the same name as a file that already exists.

In such a case, it will simply overwrite that same-named file, WITHOUT asking you for your permission to do so.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top