Article 5KDAD [SOLVED] Simple question about shell script

[SOLVED] Simple question about shell script

by
skiende74
from LinuxQuestions.org on (#5KDAD)
I want to do base64 encoding of some string 500 times repeatedly.
So I tried to use for loop, but I'm in trouble.

How do I save the result of base64 operation into variable?
I tried to this, but It didn't work.

k='string'
for i in $(seq 500)
do
k= (echo $k|base64)
done

The problem is 4th line.
echo $k|base64 do work,but k = echo $k|base64 don't work.
How do I save this operation result into k?latest?d=yIl2AUoC8zA latest?i=ZK69e3d5TlQ:D4nd6JFFae8:F7zBnMy latest?i=ZK69e3d5TlQ:D4nd6JFFae8:V_sGLiP latest?d=qj6IDK7rITs latest?i=ZK69e3d5TlQ:D4nd6JFFae8:gIN9vFwZK69e3d5TlQ
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments