Shell scripts: determining filename length

Brian D. McGrew brian at visionpro.com
Wed Sep 7 15:06:17 UTC 2005


Good morning.

I'm working on some shell scripts that process directories full of times
shared by Samba and used by Windows people.  We all know that Windows
people have a habit of really, really, really, long filenames.

In a shell script, inside a `for f in *` loop, how can I go about
finding how long a filename is ... And then truncate the name, keeping
the three letter extension, to less than 64 characters?

Thanks!

-brian
 
Brian D. McGrew { brian at visionpro.com || brian at doubledimension.com }
---
> Those of you who think you know it all,
  really annoy those of us who do!





More information about the redhat-list mailing list