mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-08 18:34:00 +00:00
Estimated hours taken: 1 <overview or general description of changes> <directory>/<file>: <detailed description of changes>
21 lines
296 B
Bash
Executable File
21 lines
296 B
Bash
Executable File
#!/bin/sh
|
|
# See if the first argument appears among the following arguments.
|
|
# If yes, return true (0), otherwise, return false (1).
|
|
|
|
if test $# -lt 1
|
|
then
|
|
echo "Usage: appears word word1 ..."
|
|
exit 2
|
|
fi
|
|
|
|
word=$1
|
|
shift
|
|
for arg in "$@"
|
|
do
|
|
if test "$word" = "$arg"
|
|
then
|
|
exit 0
|
|
fi
|
|
done
|
|
exit 1
|