March 2002
Beginner
504 pages
10h 47m
English
| 1: | Write a function named toLower that converts its arguments to all lowercase and outputs the converted string to STDOUT. (HINT: Use tr.) |
| A1: | One possible implementation is
################################################
# Name: toLower
# Desc: changes an input string to lower case
# Args: $@ -> string to change
################################################
toLower() {
echo $@ | tr '[A-Z]' '[a-z]' ;
}
|
| 2: | Write a function named toUpper that converts its arguments to all uppercase and outputs the converted string to STDOUT. (HINT: Use tr.) |
| A2: | One possible implementation is
################################################ # Name: toUpper # Desc: changes an input string to upper case # Args: $@ -> string to change ################################################ ... |
Read now
Unlock full access