How to base64 encode image in linux bash / shell

前端 未结 6 1850
说谎
说谎 2021-01-29 23:30

I\'m trying to base64 encode an image in a shell script and put it into variable:

test=\"$(printf DSC_0251.JPG | base64)\"
echo $test
RFNDXzAyNTEuSlBH

6条回答
  •  隐瞒了意图╮
    2021-01-29 23:59

    To base64 it and put it in your clipboard:

    file="test.docx"
    base64 -w 0 $file  | xclip -selection clipboard
    

提交回复
热议问题