initial commit

This commit is contained in:
Fabio Scotto di Santolo
2020-07-28 19:28:25 +02:00
commit 4cc88d2f6e
245 changed files with 22820 additions and 0 deletions

29
chapter10/function_test_string Executable file
View File

@@ -0,0 +1,29 @@
test_string ()
{
if (( $# != 1 ))
then
echo 'ERROR'
return
fi
C_STRING=$1
# Test the character string for its composition
case $C_STRING in
+([0-9])) echo 'POS_INT' # Integer >= 0
;;
+([-0-9])) echo 'NEG_INT' # Integer < 0
;;
+([a-z])) echo 'LOW_CASE' # lower case text
;;
+([A-Z])) echo 'UP_CASE' # UPPER case text
;;
+([a-z]|[A-Z])) echo 'MIX_CASE' # MIxed CAse text
;;
*) echo 'UNKNOWN' # Anything else
;;
esac
}