bash - How to decode an embedded base64 string? -
i want decode embedded base64 string.
input line:
subscriber,services,,1,dgvsois0oteymzq1njck
expected output:
subscriber,services,,1,tel:+491234567
the base64 string decoded with:
echo 'dgvsois0oteymzq1njck' | base64 -d
how can decode embedded base64 string?
if want receive second line first line, should this:
mystring="subscriber,services,,1,dgvsois0oteymzq1njck" result="${mystring%,*},$( base64 -d <<< ${mystring##*,} )" echo $result # print "subscriber,services,,1,tel:+491234567"
if need different records encoded field located in different positions, more complicated
Comments
Post a Comment