+-

我想在 Linux机器上执行命令,但我应该以base64格式发送命令.
如何在Linux命令上解码base64字符串然后执行解码后的字符串?
最佳答案
使用base64 -d:
# 'string' variable contains a base64 encoded command
command=$(base64 -d <<< "$string"); decode_status=$?
# run the command only if decode was successful
# we shouldn't enclose $command in double quotes in this case
[[ $decode_status == 0 ]] && $command
点击查看更多相关文章
转载注明原文:linux – 从base64解码并执行命令 - 乐贴网