Move under www to ease rsync
This commit is contained in:
15
www/eps/hpr2659/hpr2659_bash11_ex5.sh
Executable file
15
www/eps/hpr2659/hpr2659_bash11_ex5.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# String comparison with a pattern in a variable. The pattern matches any
|
||||
# word that ends with 'man' that is longer than 3 letters.
|
||||
#
|
||||
pattern="+([[:word:]])man"
|
||||
echo "Pattern is: $pattern"
|
||||
for str in 'man' 'woman' 'German' 'Xman' 'romance' ''; do
|
||||
if [[ $str == $pattern ]]; then
|
||||
echo "Matched '$str'"
|
||||
else
|
||||
echo "Didn't match '$str'"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user