30 Nov
2011
30 Nov
'11
22:10
On 11/30/2011 07:32 AM, David Haller wrote:
JFTR:
if test ${#str} -gt $lim; then newstr=${str:0:$((lim-end))}; perl -e "printf qq[%s%${end}s\n], qq[$newstr], qq[$chr] x $end;" else printf "$str\n"; fi
Of course you could truncate $str in perl to etc. pp, but once using perl you should probably do the whole script (or at least the function) in perl, otherwise it'll be much slower.
HTH, -dnh
It does, that was exactly what I was looking for in return. I would have been disappointed if you would have come up with a much simpler way in BASH :) -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org