IN_CERTS=$(cat in.pem)
echo -e "$IN_CERTS" > ./tmp.pem
sed -i '/^[[:space:]]*$/d' ./tmp.pem
mkdir -p _certs
csplit -s -z -f './_certs/cert-' -b '%02d.crt' ./tmp.pem '/-----BEGIN CERTIFICATE-----/' '{*}'
Created
August 12, 2021 22:14
-
-
Save gorshkov-leonid/ea019d5889028fbbe17d90b815f56399 to your computer and use it in GitHub Desktop.
How to split PEM certificates
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment