[pass] [PATCH] generate only first line (correction)
Jason A. Donenfeld
Jason at zx2c4.com
Tue May 6 15:50:57 CEST 2014
On Tue, May 6, 2014 at 3:48 PM, Matthew Cengia <mattcen at gmail.com> wrote:
> On 2014-05-06 15:36, Jason A. Donenfeld wrote:
> > I like this idea, but I want to make it happen via a simple sed one
> liner.
> > Will see if I can make it happen.
>
> Easy:
>
> replace=wibble; printf "%s\n" a b c | sed $'1c \\\n'"$replace"$'\n'
> wibble
> b
> c
>
> Bit of nasty shell quoting because MacOS sed requires the replacement to
> start on a newline, and be followed by one if you need don't want line 2
> tacked directly onto the end of line 1.
The other quoting thing is - what if $replace contains characters that sed
interprets as control? "pwgen -s -y" is pretty random, after all... I wish
sed had some way of specifying a "stdin" token.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140506/64f33cc3/attachment.html>
More information about the Password-Store
mailing list