Unix and shell-programming 2001, demo 2
Unix and shell-programming 2001, demo 2 (31 Jan 2001)
Pay attention to special cases and error situations!
- Write a function that
- prints its arguments one per line, numbered
and in single quotes (e.g., 1: 'ass');
- prints its arguments vertically one character per line
- Write a function that can be used to check if a string
contains special characters
| & ; < > ( ) $ ` \ " ' * ? [ # ~ = %
or space, tab or newline so that
- no output but return status 1 if at least one was found, 0 otherwise
- print a list of special characters found
- Write an sh script that searches for scripts that begin with #!
in a given directory, and reports which shell (or whatever) would
- Write an sh script that reads comma-separated integers from a file
and computes and prints their sum separately for each row and then total
- Write sh script addhandle that reads people's names from one file
(last name last) and nicknames from another (assume they're in same order)
and prints them together like this:
Kauko "Kake" Virtanen
i.e., adds nickname in quotes between first and last name.
- Write sh script namesplit that reads files like the previous
script's output and splits them in two so that one file has first and
last names and the other nicknames. I.e., reverse of the above.
File translated from TEX by TTH, version 1.98.
On 25 Jan 2001, 13:38.