You are not logged in.
I've got a bunch of passwords (with URLS and usernames) exported from chromium. I want to put these into pass's database. I've split the original file up so that each file contains
<password>
URL: <url>
Username: <username>and generally has some <name> according to the website.
So I want to use
pass insert --multiline web/<name> ...to add them to the database, but I don't want to do this interactively. I want to take the data from the file.
I know this is probably a stupid question, but how can I do this?
Last edited by cfr (2022-11-08 02:04:51)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
This would be a programming and scripting question; you'll need a loop that reads the file name, creates the corresponding file with pass and then writes the details.
This would be tedious. You could jerry rig a tool like this to do it: https://github.com/roddhjav/pass-import
# edit: ^ by converting your plain text files to a csv, would be the simplest approach.
Last edited by jasonwryan (2022-11-08 00:59:33)
Offline
Thanks. I just re-exported them from chromium, installed pass-import from AUR and fiddled a bit until I got the syntax right. I thought pass-import was for other password managers. I didn't realise that included password managers in browsers.
I'm still curious how I could script pass to use information from a file, because it seems a useful thing to be able to do in other contexts.
Apologies for posting in the wrong place. I realised after I'd done it scripting would have been more appropriate.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
I'm still curious how I could script pass to use information from a file, because it seems a useful thing to be able to do in other contexts.
You could tweak this: https://unix.stackexchange.com/question … rd-manager
Offline
You could tweak this: https://unix.stackexchange.com/question … rd-manager
Thanks, but I was more wondering how to substitute input from a file when something expects interactive input. So you can't just say
pass insert --multiline <name-in-store> << <file-with-data>because pass expects you to input something manually.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Yeah, that's why I was suggesting the loop: first you have to create the directory structure and files, and then write all the details.
So, read your file into an array, and then run two pass loops. Ugly, but I don't see any other way native to pass itself.
Offline
jerry rig
Mixed metaphor? I thought it was Jerry Built or Jury Rigged meaning slightly different things. Or is this a different side of the world thing?
Anyway, always good to see you.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Yeah, that's why I was suggesting the loop: first you have to create the directory structure and files, and then write all the details.
So, read your file into an array, and then run two pass loops. Ugly, but I don't see any other way native to pass itself.
Ah, OK. So I'm not missing some obvious way of feeding stuff to a command which doesn't expect anything but interactive input? I always assumed there must be some neat way of doing this I just didn't know.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline