Re: script to convert filename to lowercase
Darryl Röthering wrote:
>
> Eric:
>
> Thanks! You guys are great. Unfortunately, I now realize that I am screwed
> worse than I thought. How would I easily alter this script to list files in
> a case insensitive order? In other words, the idiots who preceeded me
> imported a few times into this directory & never paid attention to the case.
> Now I have to delete the old timestamped one and keep the latest. If I could
> just get them next to each other in sort order it would make the task
> bearable. Better yet would be to delete the older of the two.
Hi Eric.
ls -l |sort -f -k 9
or
ls |sort -f -k 9 |awk '{print $6" "$7" "$8" "$9;}'
should get the ls list sorted without concern to case. The later one
shows only time stamp and filename. I can't think of any real easy way
to automatically delete the oldest one though. I guess one could write
a fairly simple gawk script for this, but I leave this to someone who
feels safer on this than I do.
// Emil
Reply to: