Files
Ilya Shpigor 81254606dd Minor fixes
2021-03-14 12:22:29 +01:00

21 lines
300 B
Bash

#!/bin/bash
array=(Alice Bob Eve Mallory)
is_found="0"
for element in "${array[@]}"
do
if [[ "$element" == "$1" ]]
then
is_found="1"
break
fi
done
if [[ "$is_found" -ne "0" ]]
then
echo "The array contains the $1 element"
else
echo "The array does not contain the $1 element"
fi