Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save loplex/56ccb43e47b11fe2019999c6f0c8eea1 to your computer and use it in GitHub Desktop.
Save loplex/56ccb43e47b11fe2019999c6f0c8eea1 to your computer and use it in GitHub Desktop.
#!/bin/sh
# pipe "file.har" to this script
jp "log.entries[*].response.content.text" | jq -c '.[]' | tr '\n' '\0' | xargs -0 -I '{}' sh -c 'echo -e {} $"\0"'
# If you want to write responses to separate files, pipe response of this script to
# |xargs -0 sh -c 'count=0; for fl in "$@"; do echo "$fl" > "fl$(printf "%03d" "$count")"; (( count++ )); done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment