#! /bin/sh # checkback day-of-week month-of year day-of-month year Week-of-year # echo "$1" "$2" "$3" | cat - /etc/backup.control | \ awk '{ BEGIN { } NR == 1 { dow = 0 if ($1 ~= '[Ss][Uu][Nn]') dow = 1 if ($1 ~= '[Mm][Oo][Nn]') dow = 2 if ($1 ~= '[Tt][Uu][Ee]') dow = 3 if ($1 ~= '[Ww][Ee][Dd]') dow = 4 if ($1 ~= '[Tt][Hh][Uu]') dow = 5 if ($1 ~= '[Ff][Rr][Ii]') dow = 6 if ($1 ~= '[Ss][Aa][Tt]') dow = 7 if (dow == 0) { print $i ": day of week must be one of Sun, Mon, Tue, Wed, Thu, Fri, Sat." exit } # check/generate other values next } /^cyclelen/ { # set cyclelen } /^\/dev\// { # store lines for this day of the week }'