Script: dirinfo

Version 1: Give information about the current directory.

This script will display the following information about a specific directory.

If I were to run it in a directory called abc that has this directory structure:

                                abc
                                 |                                
  ________________________________________________________________
  |         |         |          |           |           |       |
  |         |         |          |           |           |       |
hello.c   helloc   hello.h   program1.c   hello.mak   1st_try search45 

The script should generate output like that shown below. The script should use one command (multiple pipes still count as one command) to generate each of following:

Information on directory abc:

1. There are 7 files.

2. The following files end in .c or .h:

hello.c hello.h program1.c

3. The following files have a digit in their name:

1st_try program1.c search45 

4. The following files are text files:

1st_try:    ASCII text
hello.c:    c program text
hello.mak:  nroff, eqn, or tbl text input text

Note: getting the exact formatting is a tricky, so first just get the output and don't worry about the formatting.

Version 2: Take one argument and report on that directory. If no argument is given, default to the current directory. If multiple arguments are given, generate the output for each one.