<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<tt>Hi Jason</tt><tt><br>
</tt><tt><br>
</tt><tt>I came across your password manager "pass</tt><tt>" and I
love it.</tt><tt> Thanks!</tt><tt><br>
</tt><tt><br>
</tt><tt>Here is what I miss an how I got around it and may be
you're going to integrate it into pass in a better fashion than I
did.</tt><tt><br>
</tt><tt><br>
</tt><tt>I organize all my data of a thing in the same multiline
pass entry. Since there are a lot of different kinds of a thing I
have to store (like normal usernames/passwords or database
connections or creditcard numbers it would be cool to supply a
template and fill in some data and store it with pass. Later it
would be cool to extract any data, not only the password, and copy
it to the clipboard.</tt><tt><br>
</tt><tt><br>
</tt><tt>Suppose we have a template like this for example called
def-template:</tt><tt><br>
</tt><tt>password:</tt><tt><br>
</tt><tt>username:</tt><tt><br>
</tt><tt><br>
</tt><tt>I can pipe this to pass like so:</tt><tt><br>
</tt>
<ul>
<li><tt>ptemp < ~/template</tt><tt>s</tt><tt>/def-template
`pwgen -yvsB 15 1` foo | pass insert -m foo/bar.com</tt></li>
</ul>
<p><tt><br>
</tt><tt>To see the result ... </tt><tt><br>
</tt></p>
<ul>
<li><tt>pass show foo/bar.com </tt><tt><br>
</tt></li>
</ul>
<p><tt>... it giving this</tt><tt><br>
</tt></p>
<ul>
<li><tt>password:V}zp*/?9{L;;x%|</tt></li>
<li><tt>username:foo</tt></li>
</ul>
<p><tt><br>
</tt><tt>Later </tt><tt>t</tt><tt>o copy the password "</tt><tt><tt>V}zp*/?9{L;;x%|"</tt>
to clipboard I can do like so:</tt><tt><br>
</tt></p>
<ul>
<li><tt>pass show foo/bar.com | pclip passw</tt></li>
</ul>
<p><tt>To copy the username "foo" to clipboard like so:</tt></p>
<ul>
<li><tt>pass show foo/bar.com | pclip usern</tt></li>
</ul>
<p><tt><br>
</tt><tt>Below are the functions pclip and ptemp from .bashrc.
(Works on linux mint bash)</tt><tt><br>
</tt></p>
<p><tt>Would be cool if you could integrate a similar thing into
pass only better than I did.</tt><tt><br>
</tt></p>
<p><tt>Have fun</tt><tt><br>
</tt><tt>Roland</tt><tt><br>
</tt></p>
<p><tt><br>
</tt></p>
<p><tt>function pclip { </tt><tt><br>
</tt><tt> grep "$1" | awk -F ':' '{print $2}' | tr -d ' ' | xclip
-se c</tt><tt><br>
</tt><tt><br>
</tt><tt>}</tt></p>
<p><tt>function ptemp {</tt><tt><br>
</tt><tt>i=0</tt><tt><br>
</tt><tt>args=( "$@" )</tt><tt><br>
</tt><tt>while read line </tt><tt><br>
</tt><tt>do</tt><tt><br>
</tt><tt> echo ${line}${args[i]}</tt><tt><br>
</tt><tt> let i++</tt><tt><br>
</tt><tt>done </tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt><br>
</tt></p>
<p><tt><br>
</tt><tt><br>
</tt></p>
<p><tt><br>
</tt></p>
</body>
</html>