Question about .bashrc and tty

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Question about .bashrc and tty

Postby Spinnifex » Oct 7th, '24, 23:25

Hello.

I want to configure my github account so sign my software commits
with my gpg key.
What I not understand is what this
Code: Select all
[ -f ~/.bashrc ] && echo -e '\nexport GPG_TTY=$(tty)' >> ~/.bashrc

does. And why I should use this.
This was explained here.
But not why I should do this.

As I understand this we tell the system that any command which want to talk to gpg on a terminal should use the
terminal found on
Code: Select all
$(tty)


I did something simillar on my .bash_profile file.
There I have the following
Code: Select all
GPG_TTY=$(tty)
export GPG_TTY
unset USERNAME


but when i call
Code: Select all
echo $GPG_TTY

I get
Code: Select all
Kein Terminal

Is this okay?

Btw. what does
Code: Select all
unset USERNAME

regards
Spinni
Spinnifex
 
Posts: 141
Joined: Nov 25th, '19, 12:38
Location: Europe / Potsdam

Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron