#!/bin/bash
#<pre><b>
# Script     : derorder
# Version    : 1.0
# Author     : Roland Rashleigh-Berry
# Date       : 03-Jun-2004
# Purpose    : Production script to list the programs that build the derived 
#              datasets in the order in which they will be run.
# SubScripts : sortnpref
# Notes      : none
# Usage      : derorder 
#===============================================================================
# PARAMETERS:
#-pos- -------------------------------description-------------------------------
# N/A  Do not supply any parameters
#===============================================================================
# AMENDMENT HISTORY:
# init --date-- mod-id ----------------------description------------------------
# 
#===============================================================================
# This is public domain software. No guarantee as to suitability or accuracy is
# given or implied. User uses this code entirely at their own risk.
#===============================================================================

# No parameters allowed
if [ $# -gt 0 ] ; then
  echo "Error: (derorder) Do not supply any parameters" 1>&2
  exit 2
fi

# List qualifying-looking files one by one
# and use grep to select more strictly
# and then sort according to their numeric prefix

ls -1 [sd]*[0-9]_*.sas | grep '^[sd][^_]*[0-9]_.*\.sas$' | sortnpref
