Files
mercury/tools/half
Zoltan Somogyi 1d5b6d0ecd Remove some redundant code.
Estimated hours taken: 0.5

binary:
	Remove some redundant code.

half:
	Use /usr/ucb/echo if it exists, since on such machines (e.g. kryten)
	the standard echo may not recognize -n.
1997-01-26 23:43:59 +00:00

18 lines
244 B
Bash
Executable File

#!/bin/sh
# Given N arguments, print the first N/2 arguments, rounding down.
if test -x /usr/ucb/echo
then
ECHO=/usr/ucb/echo
else
ECHO=echo
fi
take=`expr $# / 2`
while test $take -gt 0
do
$ECHO -n "$1 "
shift
take=`expr $take - 1`
done