Public Domain version of: yes(1)

James C. Armstrong jca at rolls.UUCP
Fri Apr 8 03:27:14 AEST 1988


I have watched all of these varieties of yes(1) come whizzing by, and
must wonder:  Are you all all that bad?

If you look closely, you'll see that you are doing a comparision on each
execution!  Why not:

if [ "$#" -gt 1 ]
then
	ans=$*
else
	ans=y
fi
while true
do
	echo $ans
done

Check what you want to echo ONCE ONLY, assign it and echo it.



More information about the Alt.sources mailing list