I have a file which contains base64 encoded image data: ~/dog/1.jpgI put it there via SSH, and base 64 encoded the data so it would be safe to transfer in the terminal. Assume the base64 image data is not corrupted.Now that I have the image data passed to the other server I need to decode the file contents and then overwrite the encoded file with the decoded file.And I can't use the base64 command as it's not available on the remote server.How can I base64 decode file contents and then overwrite the encoded file contents with the decoded contents, preferably using perl?This is what I have now...# Decode image datapoo=$(cat ~/dog/1.jpg | perl -MMIME::Base64 -ne 'printf %s\n,decode_base64($_)'); # Write decoded data to fileecho $poo >| ~/dog/1.jpgThis overwrites the file but does not properly decode the image. 
Base64 decode and overwrite file
scripting;perl;cat;base64
perl -MMIME::Base64 -i -0777ne 'print decode_base64($_)' ~/dog/1.jpgWill avoid having to use any intermediary (be it a variable or a temp file) and stores the decoded file back into the original jpeg file.