fork download
  1. #!/bin/bash
  2.  
  3. IFS= readarray -d '' arr < <(awk -v RS= -v ORS='\0' '1')
  4.  
  5. echo "Output:"
  6.  
  7. for i in "${!arr[@]}"; do
  8. echo "[$i] =>"
  9. echo "${arr[i]}"
  10. done
  11.  
Success #stdin #stdout 0.01s 5280KB
stdin
HTTP/1.1 301 Moved Permanently
Date: Thu, 09 May 2024 07:41:53 GMT
Server: Kestrel
Location: https://www.microsoft.com/
Strict-Transport-Security: max-age=31536000

HTTP/2 200 
accept-ranges: bytes
content-type: text/html
etag: "85de642e1467807f64f7e10807df3869:1711562737.176211"
last-modified: Tue, 26 Mar 2024 18:16:43 GMT
server: AkamaiNetStorage
content-length: 201253
expires: Thu, 09 May 2024 07:41:54 GMT
cache-control: max-age=0, no-cache, no-store
pragma: no-cache
date: Thu, 09 May 2024 07:41:54 GMT
stdout
Output:
[0] =>
HTTP/1.1 301 Moved Permanently
Date: Thu, 09 May 2024 07:41:53 GMT
Server: Kestrel
Location: https://www.microsoft.com/
Strict-Transport-Security: max-age=31536000
[1] =>
HTTP/2 200 
accept-ranges: bytes
content-type: text/html
etag: "85de642e1467807f64f7e10807df3869:1711562737.176211"
last-modified: Tue, 26 Mar 2024 18:16:43 GMT
server: AkamaiNetStorage
content-length: 201253
expires: Thu, 09 May 2024 07:41:54 GMT
cache-control: max-age=0, no-cache, no-store
pragma: no-cache
date: Thu, 09 May 2024 07:41:54 GMT