分页: 1 / 1

echo传递值

发表于 : 2011-05-20 20:25
罗非鱼
gpg -ase -r 0xc1868032 -u '[email protected]' file

You need a passphrase to unlock the secret key for
user: "test (key) <[email protected]>"
2048-bit RSA key, ID C1CD62CB, created 2011-05-17

You need a passphrase to unlock the secret key for
user: "test (key) <[email protected]>"
我输入密码后,指令成功运行,用echo传递数值,不成功.

echo "mykey" | gpg -ase -r 0xc1868032 -u '[email protected]' file
运行后,还是出现
You need a passphrase to unlock the secret key for
user: "test (key) <[email protected]>"
2048-bit RSA key, ID C1CD62CB, created 2011-05-17

You need a passphrase to unlock the secret key for
user: "test (key) <[email protected]>"

请问,如何修改这个语句?

Re: echo传递值

发表于 : 2011-05-20 21:11
lilydjwg
读取密码一般是直接读终端设置的,所以你需要用 expect。

Re: echo传递值

发表于 : 2011-06-12 12:16
lexdene
有的程序为了安全,
在输入密码等重要信息的时候,
要求必须使用键盘输入,而不能使用管道及重定向。

Re: echo传递值

发表于 : 2011-06-18 16:52
tusooa
大约是指定了/dev/tty

Re: echo传递值

发表于 : 2011-06-19 19:14
lexdene
tusooa 写了:大约是指定了/dev/tty
这是本质。