zx2c4@thinkpad ~ $ cat replacement-test.sh
#!/bin/sh

password="$(pwgen -s -y 900 1)"
oldfile=$'this is\nthe old file\nwith various\nnew lines\nand whatnot\n'
[[ $password == "$(sed $'1c \\\n'"$(sed 's/[\/&]/\\&/g'
<<<"$password")"$'\n' <<<"$oldfile" | head -n 1)" ]] && echo "It works!"
zx2c4@thinkpad ~ $ ./replacement-test.sh
It works!
_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to