From 9da29bce4fdd4ca0754f9c505b746d68182f6046 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Wed, 28 Feb 2024 07:09:00 +0200 Subject: Refactoring --- bin/ak-zchain-extract-cids | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 bin/ak-zchain-extract-cids (limited to 'bin/ak-zchain-extract-cids') diff --git a/bin/ak-zchain-extract-cids b/bin/ak-zchain-extract-cids new file mode 100755 index 0000000..a07c481 --- /dev/null +++ b/bin/ak-zchain-extract-cids @@ -0,0 +1,13 @@ +#!/bin/bash +# +# Extracts unique IPFS CIDs from an ak-entered zchain +# +# Previously: +# ak-enter | jq | grep Qm | sed -e 's/^.*Qm/Qm/g' | cut -d '"' -f 1 +# +if [ ! -z $1 ] && [ -n "$1" ] +then + ak-enter $1 | jq | grep Qm | sed -e 's/".*"://g; s/ //g; s/[{,"]//g' | sort | uniq +else + ak-enter | jq | grep Qm | sed -e 's/".*"://g; s/ //g; s/[{,"]//g' | sort | uniq +fi -- cgit v1.2.3