linux - How to pipe text into stdin
问题描述
I want to do something like
cat "username\npassword" | git push
so that git gets the username and password since it expects the first line of stdin as username and second line of stdin as password but it doesnt work.
What am i doing wrong
解决方案
Git specifically reads from the terminal, it does not just read from stdin (that's why you won't see your password displayed in the terminal). Most applications taht read a password will work like that.
You need to use one of Git's non-interacitve authentication methods.
推荐阅读
- android - Android如何使用聚光灯库平滑地画线
- meshlab - 将网格壳转换为实体
- python - Python - 无法获得 Outlook 文件的接收时间
- time-complexity - Floyd Warshall 算法如何在 1 秒内对 N=500 起作用?
- chisel - 为什么在 chiseltest 的最后一个时钟周期戳值会发生变化,从而导致断言失败?
- azure - 在触发器 ADF 中发送参数
- php - 通过 aws ses 从 symfony 邮件程序发送电子邮件时出错
- ruby - Sinatra 应用程序中的“Rake 无法加载此类文件”错误
- android - Recyclerview滚动滞后
- ms-access - 表显示“错误”记录,但查询返回“正确”数据?