fork download
  1. #!/bin/bash
  2. s='[the name of the link](www.example.com/a badly named thing)'
  3. sed -e ':a' -e 's/\(\[[^][]*]([^()[:space:]]*\)[[:space:]]\{1,\}\([^()]*)\)/\1-\2/' -e 'ta' <<< "$s"
Success #stdin #stdout 0.01s 5432KB
stdin
Standard input is empty
stdout
[the name of the link](www.example.com/a-badly-named-thing)