At first I assumed there was a valid reason for the original author to choose to strip a number of characters instead of a pattern, maybe some cases where an error of some kind would occur. But after more thinking, I cannot see any such case.

If this can be confirmed, here is a cleaner solution which also works both with bash and dash.

--
Raph
64,65c64
<    sourcelen=${#source}
<    file=/${i:$sourcelen}
---
>    file=${i#$source}

Reply via email to