Hi.

Certainly it will be nice to autodetect filename length limitation and
trim filename accoudingly.

But for practical and cosmetic purpose, excessively long filename looks
better if they are trimmed.  For that, only user knows how long it
should be.

This belongs to ~/.abcde.conf

Adding another example script as follows may help. (40 char limit)

STRLEN='s/^\(.......................................\).*/\1…/'
mungefilename ()
{
    # also no $ and \ no repeated _ -
    echo "$1" | sed -e 's/^\.*//' -e 's/ /_/g' | \
    tr -d ":><|*/\\\$\"'?|;,~!@#%^&*[:cntrl:]" | \
    sed -e 's/__*/_/g' |\
    sed -e "$STRLEN"
}

Reply via email to