Skip to content

Instantly share code, notes, and snippets.

@pwfcurry
Created April 7, 2025 16:07
Show Gist options
  • Save pwfcurry/f2e6ae7e8aac0ea0924dd148b99797e2 to your computer and use it in GitHub Desktop.
Save pwfcurry/f2e6ae7e8aac0ea0924dd148b99797e2 to your computer and use it in GitHub Desktop.
Compare lines in a jsonp file
set line_count (wc -l < data.jsonp)
set i 1
while test $i -lt (math $line_count + 1)
echo "Comparing lines $i and $(math $i + 1)"
diff (sed -n "$i"p data.jsonp | jq --sort-keys . | psub) (sed -n (math $i + 1)p data.jsonp | jq --sort-keys .| psub)
echo "----------------------------------------"
set i (math $i + 1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment