File: appears

package info (click to toggle)
mercury 0.9-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 18,488 kB
  • ctags: 9,800
  • sloc: objc: 146,680; ansic: 51,418; sh: 6,436; lisp: 1,567; cpp: 1,040; perl: 854; makefile: 450; asm: 232; awk: 203; exp: 32; fortran: 3; csh: 1
file content (20 lines) | stat: -rwxr-xr-x 296 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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