#!/usr/bin/perl # $Id# # tdate - modified date of a file in "touch" format use Getopt::Std; getopts("v"); while ($file = shift(@ARGV)) { # sanity check unless ( -f $file ) { die "$file - not a file"; } # get the mod time $mtime = time - 24 * 3600 * (-M $file); @mt = localtime($mtime); printf "%04d%02d%02d%02d%02d.%02d", $mt[5]+1900, $mt[4]+1, $mt[3], $mt[2], $mt[1], $mt[0]; print " $file" if $opt_v; print "\n"; } exit(0);