[4984] in SIPB bug reports

home help back first fref pref prev next nref lref last post

mosaic outputs cruft to stdout

daemon@ATHENA.MIT.EDU (jhawk@MIT.EDU)
Thu Oct 27 07:38:51 1994

From: jhawk@MIT.EDU
To: bug-sipb@MIT.EDU
Cc: yoav@MIT.EDU
Date: Thu, 27 Oct 1994 07:38:26 EDT

The recently added, much-ballyhooed ``mosaic'' script
in the sipb locker makes the error of writing commentary
cruft to stdout. While we all agree it should go to stdcruft,
and most Unices don't support such, it should instead go to stderr,
like all well-behaved annoyances.

(This is a consideration for wrappers to be placed around GNU stuff
in outland as well, as an aside...)

Instead of using:

echo 'mosaic should be run as Mosaic (note the capital M)'
echo 'I will run Mosaic for you now, but please be aware that mosaic'
echo ' will not work forever, and will go away at some point.'

It should use

echo 'mosaic should be run as Mosaic (note the capital M)' >&2
echo 'I will run Mosaic for you now, but please be aware that mosaic' >&2
echo ' will not work forever, and will go away at some point.' >&2

Or possibly something fancy with (just to prove you understand shell)

exec 4>&1 >&2
[your stuff here]
exec >&4

or somesuch; I was never good at that part; I suppose it's debatable
how more efficient it is, and probably varies from implementation to
implementation (the quoting is definitely superfluous no all but the
1st line, though I suppose some bogus argument about consistancy
should be made. It's amazing how horribly csh-oriented MIT people are,
they forget where they were Bourne...

--jhawk

ps: Go read more tchrist

pps: Rethinking for a moment, I suppose the following would be more
conventional, but it's unclear to me how much cat loses by not being
a shell builtin:

#!/bin/sh
cat <<Y >&2
mosaic should be run as Mosaic (note the capital M)
I will run Mosaic for you now, but please be aware that mosaic
will not work forever, and will go away at some point.
Y
exec /mit/sipb/bin/Mosaic "$@"

ppps: perhaps cat should be replaced with, say ``fmt''. Probably
``mosaic'' should be replaced with ``$0''. Well, you cannot have
everything, but _still_. It might not be unreasonable for the
script to also confirm that the first Mosaic (``which Mosaic'') is
indeed one that the user should be running, or, if that's not the
case, run the ``which Mosiac'' variant instead of the one in the
sipb locker, or sumpin', but there's certainly an inconsistancy.

p^4s: go read more comp.unix.shell.

p^5s: Oh yeah; you can quote the newlines and use one echo command. That'd
be even more intelligent -- why didn't I think of that. It must be a 
mental block. Use a construct like:

	echo 'foo bar baz
	blatch ugh more
	quux quux quux' >&2

p^6s: Rewrite in nroff.

home help back first fref pref prev next nref lref last post