[arch-general] How to suppress the list of variables that are output at shell login?
Hi, Whenever I login in zsh using an `su -l user` command, I get the following list of variables outputted on the shell HOME=/home/user LOGNAME=user PATH=/usr/bin:/usr/local/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/share/backuppc/bin SHELL=/bin/zsh TERM=xterm USER=user How can I suppress this message? -- Jayesh
Hi, I'm using zsh and this doesn't happen here. What does the .zshrc of the user you're su-ing into look like? Have you seen this page? https://wiki.archlinux.org/index.php/Zsh -- Best regards, Alexander Rødseth xyproto / TU
Hi, On Mon, Jan 7, 2013 at 1:46 PM, Alexander Rødseth <rodseth@gmail.com> wrote:
Hi,
I'm using zsh and this doesn't happen here. What does the .zshrc of the user you're su-ing into look like? Have you seen this page? https://wiki.archlinux.org/index.php/Zsh Yes, I have seen that page. My .zshrc is as attached. All the lines till the line
# End of Lines added by compinstall were added by the script that runs on zsh for the first time. The rest of the lines have been added by me manually. Also, I now think the problem is not with zsh but is more general, since the same thing happens for my root account which has a bash login shell. -- Thanks Jayesh
On Mon, Jan 7, 2013 at 9:49 AM, Jayesh Badwaik <jayesh.badwaik90@gmail.com>wrote:
Hi,
On Mon, Jan 7, 2013 at 1:46 PM, Alexander Rødseth <rodseth@gmail.com> wrote:
Hi,
I'm using zsh and this doesn't happen here. What does the .zshrc of the user you're su-ing into look like? Have you seen this page? https://wiki.archlinux.org/index.php/Zsh Yes, I have seen that page. My .zshrc is as attached. All the lines till the line
# End of Lines added by compinstall
were added by the script that runs on zsh for the first time. The rest of the lines have been added by me manually.
Also, I now think the problem is not with zsh but is more general, since the same thing happens for my root account which has a bash login shell.
Take a look at the other files source by the shell, particularly /etc/profile and /etc/profile.d/*. Chances are that something in there is doing a single `set` or similar. 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. HTH -- Rodrigo
Hi, On Mon, Jan 7, 2013 at 5:18 PM, Rodrigo Rivas <rodrigorivascosta@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
On Mon, Jan 07, 2013 at 05:51:39PM +0530, Jayesh Badwaik wrote:
Hi,
On Mon, Jan 7, 2013 at 5:18 PM, Rodrigo Rivas <rodrigorivascosta@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
No package owns this file. Where did it come from?
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
Ew.
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?
No, this happens because nothing is passed to xargs, which results in: eval `echo export` Or, simple running 'export'. You'll see that running export without any arguments simply dumps a list of exported variables. I'd suggest removing this file entirely if no package owns it and using something like keychain if you want a singleton ssh-agent for your user.
Hi,
I'd suggest removing this file entirely if no package owns it and using something like keychain if you want a singleton ssh-agent for your user.
Thanks. -- Jayesh
participants (4)
-
Alexander Rødseth
-
Dave Reisner
-
Jayesh Badwaik
-
Rodrigo Rivas