On Tue, May 6, 2014 at 3:48 PM, Matthew Cengia <[email protected]> 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.
_______________________________________________ Password-Store mailing list [email protected] http://lists.zx2c4.com/mailman/listinfo/password-store
