Strip prefix from variable - bash [duplicate]
问题 This question already has answers here : Remove a fixed prefix/suffix from a string in Bash (9 answers) Closed last year . Adding a shell script (/bin/bash) to an automator workflow (copy file path) I want to use this to strip the constant prefix '/Volumes/' from the variable path which is being copied to the clipboard. EG The copy file path workflow copies '/Volumes/GRAID/audiovideo.mov' to the clipboard, the path I desire to paste is 'GRAID/audiovideo.mov' 回答1: To remove a known constant