[arch-general] How to suppress the list of variables that are output at shell login?

Jayesh Badwaik jayesh.badwaik90 at gmail.com
Mon Jan 7 07:21:39 EST 2013


Hi,

On Mon, Jan 7, 2013 at 5:18 PM, Rodrigo Rivas
<rodrigorivascosta at gmail.com> wrote:
> You may also add a `echo $profile` command in the /etc/profile file, just
> after `for profile in /etc/profile.d/*.sh; do` to see the trace of sourced
> files.

Thanks for the suggestion. I implemented this and got the following output.
/etc/profile.d/gpg-agent.sh
declare -x HOME="/root"
declare -x LOGNAME="root"
declare -x OLDPWD
declare -x PATH="/usr/bin:/usr/local/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
declare -x PWD="/root"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x TERM="xterm"
declare -x USER="root"
/etc/profile.d/gpm.sh
/etc/profile.d/jdk.sh

I guess, this means the gpg-agent.sh is the one outputting all the
terms. So, I read the gpg-agent.sh and here is the output for the
same:
if pgrep -u "${USER}" gpg-agent >/dev/null 2>&1; then
    eval `cat $gnupginf`
    eval `cut -d= -f1 $gnupginf | xargs echo export`
else
    eval `gpg-agent --enable-ssh-support --daemon`
fi


And after commenting lines selectively, the line

eval `cut -d= -f1 $gnupginf | xargs echo export`

seems to be outputting all the variables. I am not sure what this line
does exactly. I am guessing that it checks if the gpg daemon is on,
and if it is not, it turns it on, and if it is, it lists some
environment variables, according to some condition. I am not sure
which.

Is my guess correct? In which case, would it be safe to comment the lines?




--
Jayesh


More information about the arch-general mailing list