sed commands to remove leading or trailing slashes from a path.

# strip `leading` slash from path
echo "/usr/home/www/site/app/vendor" | sed -e 's/^\///'

# strip `trailing` slash from path
echo "/usr/home/www/site/app/vendor/" | sed -e 's#/$##'