Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
The variabls that export exports should be avilable to all
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2138
Location: $TERM

PostPosted: Sun May 30, 2010 10:27 am    Post subject: Reply with quote

Code:
# /etc/profile: login shell setup
#
# That this file is used by any Bourne-shell derivative to setup the
# environment for login shells.
#

# Load environment settings from profile.env, which is created by
# env-update from the files in /etc/env.d
if [ -e /etc/profile.env ] ; then
   . /etc/profile.env
fi

# 077 would be more secure, but 022 is generally quite realistic
umask 077

# Set up PATH depending on whether we're root or a normal user.
# There's no real reason to exclude sbin paths from the normal user,
# but it can make tab-completion easier when they aren't in the
# user's PATH to pollute the executable namespace.
#
# It is intentional in the following line to use || instead of -o.
# This way the evaluation can be short-circuited and calling whoami is
# avoided.
#if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
#   PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
#else
#   PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
#fi
#export PATH
#unset ROOTPATH
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"

# Extract the value of EDITOR
[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
[ -z "$EDITOR" ] && EDITOR="/bin/nano"
export EDITOR

if [ -n "${BASH_VERSION}" ] ; then
   # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
   # including color.  We leave out color here because not all
   # terminals support it.
   if [ -f /etc/bash/bashrc ] ; then
      # Bash login shells run only /etc/profile
      # Bash non-login shells run only /etc/bash/bashrc
      # Since we want to run /etc/bash/bashrc regardless, we source it
      # from here.  It is unfortunate that there is no way to do
      # this *after* the user's .bash_profile runs (without putting
      # it in the user's dot-files), but it shouldn't make any
      # difference.
      . /etc/bash/bashrc
   else
      PS1='\u@\h \w \$ '
   fi
else
   # Setup a bland default prompt.  Since this prompt should be useable
   # on color and non-color terminals, as well as shells that don't
   # understand sequences such as \h, don't put anything special in it.
   PS1="`whoami`@`uname -n | cut -f1 -d.` \$ "
fi

for sh in /etc/profile.d/*.sh ; do
   if [ -r "$sh" ] ; then
      . "$sh"
   fi
done
unset sh
HISTCONTROL=ignoredups


That path variable is working (I modified it).

Quote:
Are you using bash for your shell, or something more exotic?


Yes, I'm using bash.
_________________
Buy from companies supporting opensource -- IBM, Dell, HP, Hitachi, Google etc...
Disfavor companies supporting only Win -- Logitech, Epson, Adobe, Autodesk, Pioneer, Kingston, WD, Yahoo, MSI, XFX
My blog
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7403
Location: Somewhere over Atlanta, Georgia

PostPosted: Sun May 30, 2010 11:52 am    Post subject: Reply with quote

In your /etc/profile, PATH is exported and HISTCONTROL is not. Thus PATH is visible to child shells and HISTCONTROL is not. (Look in /etc/profile.env, which is a file that is generated by env-update and sourced by /etc/profile, to see where PATH is exported.) So there's your explanation.

You've kind of mucked up your /etc/profile. If I were you, I'd fetch a fresh copy of it from the baselayout package and make all of your future changes in the /etc/env.d/ files. Because of the config protect feature, you'll need to fetch it from the unpacked work directory:
Code:
# EBUILD=`equery which baselayout`
# WORKDIR=`ebuild $EBUILD unpack | awk '/>>> Source/ { print $5 }'`
# cp $WORKDIR/baselayout*/etc/profile /etc
# ebuild $EBUILD clean
# unset EBUILD WORKDIR

- John
_________________
This space intentionally left blank.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2138
Location: $TERM

PostPosted: Mon May 31, 2010 4:23 am    Post subject: Reply with quote

Ok, I did not export.

Thanks, now it's working.
_________________
Buy from companies supporting opensource -- IBM, Dell, HP, Hitachi, Google etc...
Disfavor companies supporting only Win -- Logitech, Epson, Adobe, Autodesk, Pioneer, Kingston, WD, Yahoo, MSI, XFX
My blog
Back to top
View user's profile Send private message
johnlu
Apprentice
Apprentice


Joined: 22 Aug 2004
Posts: 225
Location: Córdoba, España

PostPosted: Tue Jan 29, 2013 9:03 am    Post subject: Reply with quote

Wouldn't it be better to do something like this?

/etc/env.d/99histcontrol:
HISTCONTROL="ignoreboth"

_________________
http://www.juanluperez.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum