[net.unix] Little question on 'cat'

dan@haddock.UUCP (07/03/84)

#R:tektroni:-280700:haddock:16700023:000:1011
haddock!dan    Jun 30 13:13:00 1984

> If you don't have more, the folllowing shell script should work nicely:
> for i in $*
> do
>   echo "***** $i *****\n"
>   /bin/cat $i
> done
> Put this in a file called "cat" in your own bin directory (or any
> directory for that matter), and make sure that the directory will be
> searched before /bin (i.e. PATH=$HOME/bin:$PATH) and voila! you now
> have a cat command that identifies the files before printing them.

You also have a broken environment.  'Cat' is occasionally used by shell
scripts, and those scripts expect it to do what it did originally.  This
shell script should either NOT be called 'cat', or it should parse its args
for a flag to obtain this behavior (-T for title, perhaps)?

Some people maintain that shell files should always set PATH=/bin:/usr/bin.
Whether they should or not, they often don't (and I've occasionally made
good use of that fact), so any time you provide your own identically-named
version of a common UNIX command, it should be upward-compatible.

	Dan Franklin