fork(1) download
  1. #!/bin/bash
  2. s='[Royal Enfield Flying Flea](RE Flying Flea)
  3. [Some string here](another string there)'
  4. sed -E ':a;s/(\[[^][]*]\([^()[:space:]]*)[[:space:]]([^()]*\))/\1%20\2/;ta' <<< "$s"
  5.  
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
[Royal Enfield Flying Flea](RE%20Flying%20Flea)
[Some string here](another%20string%20there)