Scott M. Mcdermott

UNIX Systems & Network Administrator
available for contract or salaried positions

filedate

#
# print the timefmt-formet date of files given as arguments
# in respective order to their positional offset on the
# command line
#

source ~/lib/sh/include
require field

filedate ()
{
        local i

        [[ "$HISTTIMEFORMAT" ]] || {
                echo "HISTTIMEFORMAT must be set in the environment"
                exit 1
        }

        for ((i = 1; i <= $#; i++)); do
                ls -1dl --time-style=+$HISTTIMEFORMAT $@ |
                field 6
        done
}
# vim:syn=sh:ft=sh