[pass] [PATCH] generate only first line (correction)

Matthew Cengia mattcen at gmail.com
Tue May 6 15:48:45 CEST 2014


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.

-- 
Regards,
Matthew Cengia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: Digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140506/239a1031/attachment.asc>


More information about the Password-Store mailing list