Not able to export key in cygwin bash: -bash: $'\302\226\302\226gpg': command not found

0

So just today I installed cygwin and its default packages, and then since GPG wasnt a part of it, I installed it manually by running setup wizard again. I needed to make a 2048 RSA GPG key and made one successfully using the command gpg --gen-key . The main reason for this was to add my GPG key to github and use it for signing my commits. For this first I need to export my GPG key like: gpg --armor --export keyid

But when I do this, I get a really strange error: -bash: $'\302\226\302\226gpg': command not found

I do not understand what this means, googling did not show up any results and this error doesn't make any sense to me ! Someone please help. Thanks.

P.S: I tried this guide how to install gpg on cygwin? currently it's missing and installed GPG2, but this too returned the same error :-(

the_Ma5TeR

Posted 2018-04-20T08:29:17.290

Reputation: 1

$'\302\226' is 0xC2 0x96 aka U+0096 in UTF-8 encoding but why exactly you have this control character twice in front of your gpg command is beyond me. Probably examine your keyboard settings and/or the file which contains this command. Did you copy/paste it from a web page or type it in on your keyboard? The fix is nominally easy; remove this gunk from in front of the gpg command. – tripleee – 2018-04-20T08:56:14.360

At the Bash command line, ctrl-P ctrl-A ctrl-D ctrl-D ret will recall the previous line from your command history and remove the first two characters, then resubmit the command. – tripleee – 2018-04-20T09:00:16.667

@tripleee no, I entered the command using the keyboard. Could you please elaborate what else I need to do ? – the_Ma5TeR – 2018-04-20T09:18:05.563

In more detail than the exact keystrokes? I don't really understand what more I could possibly provide. Click the window, enter the command ...? "Ctrl-P" means press and hold the Ctrl (also variously labelled Control or ctl) key, then quickly press the P key, then release both. – tripleee – 2018-04-20T09:20:54.563

But if something in Cygwin is putting those control characters there and you are unable to remove them by editing, I really don't know. As a workaround, you can put the commands in a text file and make it executable, then maybe you can double-click the file to execute it ...? – tripleee – 2018-04-20T09:26:02.427

what is the output of gpg --list-keys or gpg2 --list-keys ? – matzeri – 2018-04-20T16:40:33.797

No answers