Originally posted by paraiso
Thank you Komakino for the perl script ! Is that the only way ? I needed this truncation to be one of the step actions within a shell script.
Hmm, well the same thing must be possible in bash...
But assuming you have perl installed, you can still call it as part of a bash script. Something like:
i=`perl trunc /usr/bin/file`
will echo the truncated filename.
Sorry I can't be more help, I do most of my scripting in Perl.