[pass] [PATCH] clip: Show an error message if xclip returns a non-zero exit code
Kjetil Torgrim Homme
kjetil.homme at redpill-linpro.com
Mon Jan 19 13:34:54 CET 2015
On 01/19/2015 11:45 AM, Jason A. Donenfeld wrote:
> On Fri, Jan 16, 2015 at 8:38 PM, Wieland Hoffmann <themineo at gmail.com> wrote:
>
> echo -n "$1" | xclip -selection "$X_SELECTION"
> + [ $? -ne 0 ] && die "Error: Could not copy data to the
> clipboard."
>
>
> Pass uses [[ and ]] when it can.
in this case, that gratuitous bashism :) can easily be avoided by the
IMHO more idiomatic:
echo -n "$1" | xclip -selection "$X_SELECTION" ||
die "Error: Could not copy data to the clipboard."
--
thanks,
Kjetil T. Homme
Redpill Linpro - Changing the game
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20150119/e812c88d/attachment.asc>
More information about the Password-Store
mailing list