當我使用“$ pass insert [..]”時,終端掛起

當我使用“$ pass insert [..]”時,終端掛起

這篇文章是關於實用程式的pass。它對我來說效果很好,除非我嘗試使用

$ pass insert Email/gmail/myname

我的終端機有提示

Enter password for Email/gmail/myname: _

並掛起,到目前為止,除了Ctrl-C停止程序之外,沒有擊鍵影響它。有趣的是,該程式確實創建了目錄~/.local/share/password-store/Email/gmail/。以前有人遇到過同樣的問題嗎?

pass(我在拱門上使用v1.7.3。)

答案1

對於互動式插入,該enter鍵表示您已完成密碼輸入:

$ pass insert test
Enter password for test:   [keystrokes: asdf<enter>]
Retype password for test:  [keystrokes: asdf<enter>]

$ pass test
adsf

此外,使用--echo-e您可以透過 stdin 從管道獲取輸入。

testo例如,我使用密碼輸入hello world

$ echo "hello world" | pass insert --echo testo
[main b451b23] Add given password for testo to store.
 1 file changed, 1 insertion(+)
 create mode 100644 testo.gpg

$ pass testo
hello world

但這僅適用於單行。對於多行輸入,請使用--multiline標誌而不是--echo

$ man pass
$ echo "password123" > passfile.txt
$ echo "Email: [email protected]" >> passfile.txt
$ cat passfile.txt | pass insert --multiline test
Enter contents of test and press Ctrl+D when finished:

[main e1acd8e] Add given password for test to store.
 1 file changed, 1 insertion(+)
 create mode 100644 test.gpg

$ pass test
password123
Email: [email protected]

手冊頁中的文檔沒有提到enter按終止輸入,也許我會透過電子郵件發送開發者郵件列表關於它。這是當前的man pass

       insert [ --echo, -e | --multiline, -m ] [ --force, -f ] pass-name
              Insert  a  new  password  into the password store called pass-name. This will read the new password from standard in. If --echo or -e is not
              specified, disable keyboard echo when the password is entered and confirm the password by asking for it twice. If --multiline or -m is spec‐
              ified,  lines will be read until EOF or Ctrl+D is reached. Otherwise, only a single line from standard in is read. Prompt before overwriting
              an existing password, unless --force or -f is specified. This command is alternatively named add.

相關內容