Hacker News new | past | comments | ask | show | jobs | submit login

In a dozen or so years of administrating many different Unix machines, I've never had cron email be a problem and I get a few (useful) emails from various cron scripts every day.

This interacts badly with many unix commands, which often send status info to standard out. Some commands have a quiet options, but that can turn off all error output too.

Maybe it's that I've mostly been administrating BSD machines, and so most of the tools follow old Unix guidelines like not printing anything unless it's necessary, echoing errors to stderr, using proper exit statuses, etc. (http://fmg-www.cs.ucla.edu/geoff/interfaces.html) I think it's a GNUism/Linuxism that commands are overly chatty, writing junk all over stdout (like author/license information - do we need to see this every single time?), and using ANSI colors by default.




Which tools are you talking about? The standard software suite is basically identical between the systems. And what differences there are lie in the implementations of the core stuff, whose behavior is specified by POSIX for the most part.

I'm sure there are exceptions somewhere. But in something you'd throw into a cron job? Frankly, that seems like a very weird snipe.


I'm guessing ls which colors; perhaps keychain (very colorful output).

I see less of the license stuff these days but no doubt there's a few around.


On Red Hat based systems, ls is an alias for ls --color=auto which means that colors are used only on terminals, not pipes or files.


And no one should ever be using ls in a shell script anyway. Shell globbing and find are the proper tools.


Debian has this as well. I do "unalias -a" whenever I log into an account I haven't configured to my liking yet (I want no ls coloring, but I do want a bash prompt in boldface).


I think it's an OSX-ism.

Most OSX devs I've seen treat their command-line utilities like their GUI utilities, with nice looking albeit chatty output.

These utilities then get released into the Linux world, where they often work without any modification.


Or it's just younger devs, who like to see something when they run their program.


Yes, exactly this. I know I'm guilty of wanting to see something cool happen. :)


I remember getting an angry email from someone because of this when I was back at uni, had just finishing installing a linux box at home, but hadn't finished configuring everything. I went to bed while it was busily running cron jobs throughout the remainder of the night and emailing the output to someone else who had the same username at my ISP as the local one I'd set up on the machine. I don't think he saw the funny side of it sadly.


You're bang on. Commands should do what you tell them and say nothing unless something unexpected occurred. (or, if you asked them to say something)

Cron isn't broken. It's chatty programs that are broken.


So you can scream at the darkness or light a candle. It doesn't matter which is broken if you can only fix one.


I don't quite think that its a "gnuism" to do that. They generally take a --color option which of course is off by default.

They did sometimes put the license everytime, a long time ago, but I don't see that anymore unless you ask the version or help.


GNU programs that show a license and copyright information at startup do so when used interactively, not when in batch mode. For example:

echo 1 + 2 | bc

That doesn't produce anything except "3", even with GNU bc.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: