加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

在bash中重定向STDIN?

发布时间:2020-12-15 17:02:53 所属栏目:安全 来源:网络整理
导读:举个例子,我想用密码登录 mysql.我知道我可以使用-pmypass,但我想学习如何在bash中重定向stdin.所以我的测试是 mysql -u limited_user -p text to redirect into stdin when it prompts for my pass 我看到了文件名之前,但我不想将数据存储在文件中.我试过和
举个例子,我想用密码登录 mysql.我知道我可以使用-pmypass,但我想学习如何在bash中重定向stdin.所以我的测试是
mysql -u limited_user -p <text to redirect into stdin when it prompts for my pass>

我看到了<文件名之前,但我不想将数据存储在文件中.我试过&和& - 但没有运气.我不确定& - 是什么.

通常,它只是:
echo password|command

但是许多读取密码的程序,包括MySQL,实际上并没有从stdin中读取.相反,它们直接与终端交互.见Trick an application into thinking its stdin is interactive,not a pipe.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读