Closed sidneicarlos closed 7 years ago
formatKey() { TYPE="${1}" KEY="${2}" echo "" echo "-----BEGIN RSA ${TYPE} KEY-----" echo "${KEY}" | sed -r 's/(.{65})/\1\n/g' echo "-----END RSA ${TYPE} KEY-----" }
Some tests and I found this:
$ a="MIIJKQIBAAKCAgEAycLwXe3lXQcm3xmuVdMg3G2CnUgskl1GkQZjJWdhdiAun4ZM/h1wqGgQkWTD7AGj60OE2ahYIBpMY+n7ofCBDXjV74AFIxEvQTX5deLD234x5o+0" $ echo "$a" | sed -r 's/(.{65})/\1\n/g' MIIJKQIBAAKCAgEAycLwXe3lXQcm3xmuVdMg3G2CnUgskl1GkQZjJWdhdiAun4ZM/ h1wqGgQkWTD7AGj60OE2ahYIBpMY+n7ofCBDXjV74AFIxEvQTX5deLD234x5o+0 $ echo "$a" | sed -r 's/(.{64})/\1\n/g' MIIJKQIBAAKCAgEAycLwXe3lXQcm3xmuVdMg3G2CnUgskl1GkQZjJWdhdiAun4ZM /h1wqGgQkWTD7AGj60OE2ahYIBpMY+n7ofCBDXjV74AFIxEvQTX5deLD234x5o+0
I think the line could be echo "${KEY}" | sed -r 's/(.{65})/\1\n/g'
echo "${KEY}" | sed -r 's/(.{65})/\1\n/g'
And again... Thanks for the great work
Some tests and I found this:
I think the line could be
echo "${KEY}" | sed -r 's/(.{65})/\1\n/g'