filters

Matthew Farwell dylan at ibmpcug.co.uk
Fri Dec 21 00:22:40 AEST 1990


In article <1990Dec15.175917.27136 at comm.wang.com> lws at comm.wang.com (Lyle Seaman) writes:
>dylan at ibmpcug.co.uk (Matthew Farwell) writes:
>>Sorry, but I find typing 'cat foobar' quite a bit easier than typing
>>'dd if=foobar of=/dev/tty bs=512'. Strange, I know, but its this little
>>idiosyncracy of mine.
>> [ ... etc ... ]
>So write an alias or a shell script if you want that special functionality.
>There's no point in burdening the world with {code, documentation, user
>interface} bloat for the sake of features that are adequately provided
>elsewhere.

Yes I will straight away. Now lets see.....

-rwx--x--x   1 bin      bin         9525 Apr 13  1987 /bin/cat*

Now if I write a shell script called 'cat' such as:

#!/bin/sh
if [ $# = 0 ] 
then
	dd bs=512 2> /dev/null
else
	for i in $*
	do
		dd if=$i bs=512 2> /dev/null
	done
fi

(apologies for my shell programming if its wrong)

-rwx--x--x   2 bin      bin        47228 Jul 13  1988 /bin/sh*

Ok, so my super-duper shell script should work brilliantly for cat.
Ok, it'll take longer to load + execute, and on some machines i can't
exec() it, but I can rewrite my code to get round that can't I?

All for 9k's worth of disk space. Sigh, I don't know, some people.....

Dylan.

p.s. Sorry, I forgot the documentation too. On my machine, that comes to
an extra 1.5k. Even more savings!!!!!
-- 
Matthew J Farwell                 | Email: dylan at ibmpcug.co.uk
The IBM PC User Group, PO Box 360,|        ...!uunet!ukc!ibmpcug!dylan
Harrow HA1 4LQ England            | CONNECT - Usenet Access in the UK!!
Phone: +44 81-863-1191            | Sun? Don't they make coffee machines?



More information about the Comp.unix.programmer mailing list