fork download
  1. #!/bin/bash
  2. s='/word1 /word2 //word3'
  3. sed -E 's~(/{2,})|/~\1~g' <<< "$s"
Success #stdin #stdout 0.01s 5532KB
stdin
Standard input is empty
stdout
word1 word2 //word3