Fixed multiple append/prepend bug in bash/functions/path

When appending/prepending multiple (>2) directories to a path,
the 1st dir got appended/prepended once, then the 2nd dir got
appended/prepended multiple times (N-1 times).