#!/bin/bash
## list the header info of all bash scripts.
## date: Feb. 01, 2016.
## author: Xiaoxu Guan at LSU HPC.

echo

LIST=(*.bash)  # this's is an array.


if [[ ${#LIST[@]} -eq 0 ]] ;  then
   echo "Bash scripts were not found."
   echo "exit 10"
   exit 10
else
   echo "bash script list: "  ${LIST[@]} 
   echo "Number of bash scripts is "  ${#LIST[@]}
fi


echo


# loop through all scripts.
for myscript in "${LIST[@]}" ; do
    echo "$myscript" ; head -2 $myscript  |  tail -1 ; echo
done


echo
