fork(2) download
  1. #!/usr/bin/env bash
  2.  
  3. shopt -s extglob
  4.  
  5. output=""
  6. while IFS= read -r line; do
  7. case $line in
  8. @(name|source|destination)" = "*)
  9. output+="${line%,} | " ;;
  10. "")
  11. printf '%s\n' "${output%' | '}"
  12. output=""
  13. ;;
  14. esac
  15. done
  16. [[ $output ]] && printf '%s\n' "${output% | }"
Success #stdin #stdout 0s 4536KB
stdin
name = "Account - UU ",
source = "1-account",
destination = "account-manager12",
other = 111111 

name = "Account - PP,
source = "2-account",
destination = "account-manager1234",
other = 1212

name = "Account - GG ",
source = "3-account",
destination = "account-manager12345",
other = 44444

name = "Account - QQ,
source = "4-account",
destination = "account-manager123456"
other = 23232323
stdout
name = "Account - UU " | source = "1-account" | destination = "account-manager12"
name = "Account - PP | source = "2-account" | destination = "account-manager1234"
name = "Account - GG " | source = "3-account" | destination = "account-manager12345"
name = "Account - QQ | source = "4-account" | destination = "account-manager123456"