BEN RITCHEY wrote:
> 
> Would it be possible in a Bash script to munge a 
> Long File Name to the older DOS 8.3 format?
> In my case I need the first 8 characters and the 
> last 4 (.xxx) 

To which Paul Kraus replied:
> It would be a lot easier to do it with gawk or perl.

And hackob said:
> Use cut and/or gawk

Actually guys, all you need is bash:
--------------------------------------------------
example="long-filename.to.munge.txt"
echo ${example%${example#????????}}.${example##*.}
--------------------------------------------------

Cheers,
Steven

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to