From: Junio C Hamano Date: Sun, 14 Aug 2016 20:42:37 GMT Subject: Re: [PATCH] squash! diff: add --diff-line-prefix option for passing in a prefix Message-ID: In-Reply-To: <5ca415f99718b1792cd0a9c31606b45d27befc48.1471164824.git.johannes.schindelin@gmx.de> Johannes Schindelin writes: > - test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g') > + test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g' -e 'y/>/_/') The existing sed scriptlet says "we cannot have slash and do not want to have space in filename, so we squash runs of them to a single underscore". If you have more characters that you do not want, you should add that to the existing set instead. While you are at it, it may be sensible to add a colon to that set, too, no? Something like this, perhaps? > - test=$(echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g') > + test=$(echo "$cmd" | sed -e 's|[/ <:>][/ <:>]*|_|g')