mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
15 lines
229 B
Bash
15 lines
229 B
Bash
#!/bin/bash
|
|
|
|
array=(Alice Bob Eve Mallory)
|
|
|
|
for element in "${array[@]}"
|
|
do
|
|
if [[ "$element" == "$1" ]]
|
|
then
|
|
echo "The array contains the $1 element"
|
|
exit 0
|
|
fi
|
|
done
|
|
|
|
echo "The array does not contain the $1 element"
|