mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-08 18:34:00 +00:00
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.
18 lines
244 B
Bash
Executable File
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
|