On Fri, Jan 19, 2007 at 02:58:16PM +1100, Rick Welykochy wrote:
> Peter Hardy wrote:
>
> >Peter Hardy wrote:
> >
> >>for file in `ls`; do
> >> date=`ls -l --time-style=long-iso "$file" | awk '{ print "$6 $7" }'
> >> newname=`date -d "$date" +%Y%m%d%H%M`
> >> mv "$file" $newname
> >
> >
> >Er, that should be awk '{ print $6" "$7 }'
> >
> >>* Only partially tested. Your mileage liable to variance.
> >
> >
> >...told you so.
>
> What if you have two files with the same timestamp.
> What do you wish to happen?
change mv to mv "$file" "$newname.$file" > > > -rw > > > > -- > _________________________________ > Rick Welykochy || Praxis Services > > The 7 R's of Windows support: retry, restart, reboot, reconfigure, > reinstall, reformat and finally, replace with Linux. > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html >
signature.asc
Description: Digital signature
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
