fork download
  1. #!/bin/bash
  2. s='![top command output linux](./img/wp-content-uploads-2022-04-top-command-output-linux.jpg)'
  3. sed 's~!\[\([^][]*\)](\./img/\([^()]*\))~{{< image alt="\1" src="/images/post/\2" >}}~g' <<< "$s"
  4. sed -E 's~!\[([^][]*)]\(\./img/([^()]*)\)~{{< image alt="\1" src="/images/post/\2" >}}~g' <<< "$s"
  5. # {{< image alt="top command output linux" src="/images/post/wp-content-uploads-2022-04-top-command-output-linux.jpg" >}}
  6.  
Success #stdin #stdout 0.01s 5348KB
stdin
Standard input is empty
stdout
{{< image alt="top command output linux" src="/images/post/wp-content-uploads-2022-04-top-command-output-linux.jpg" >}}
{{< image alt="top command output linux" src="/images/post/wp-content-uploads-2022-04-top-command-output-linux.jpg" >}}