How to remove /volumes/ from my automator service using existing shell script I have this shell script from here. Right now it outputs something like this:

File Path: afp://serveraddress.com/Volumes/Sharepoint/Folder/test.txt Parent Folder: afp://serveraddress.com/Volumes/Sharepoint/Folder


If I were to paste this into a browser it fails because of the /Volumes/ portion of the output.

Is there a way to use this same output but strip the volumes from the output? My current code looks like this:

toTheClipboard="File Path: afp://serveraddress.com$(echo $1 | sed 's/ /%20/g') Parent Folder: afp://serveraddress.com$(dirname "$1" | sed 's/ /%20/g')"
pbcopy&lt;&lt;&lt;"$toTheClipboard"
This is how I'd do it:

toTheClipboard="File Path: afp://serveraddress.com$(sed -e 's: :%20:g' -e 's:/Volumes::' &lt;&lt;&lt; "$1") Parent Folder: afp://serveraddress.com$(dirname "$1" | sed -e 's: :%20:g' -e 's:/Volumes::')"
pbcopy&lt;&lt;&lt;"$toTheClipboard"