fork(3) download
  1. #!/bin/bash
  2. s='https://s...content-available-to-author-only...n.tld/[...]
  3. https://s...content-available-to-author-only...n.tld/test/[...]
  4. https://s...content-available-to-author-only...n.tld/[...]
  5. https://s...content-available-to-author-only...n.tld/files/[...]'
  6. grep -oP 'https?://\K[\w-]+(?=\.stage\.domain\.tld)' <<< "$s"
Success #stdin #stdout 0s 4436KB
stdin
Standard input is empty
stdout
subdomain1
subdomain2