First example: Output of files
[example file]
j=${i%$old}$new
From the name i (not its content) the right string (%) $old is deleted, the value of this operation is returned, the new string $new is added. Left strings are deleted by #.