This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Konsole variables

Tags: konsole konsole konsole
(comma "," separated)
lrhorer
Registered Member
Posts
7
Karma
0

Konsole variables

Sun Aug 23, 2009 10:47 am
OK, I've done this before, but for the life of me I cannot remember how. There are some environment variables, specifically some aliases such as `alias ll="ls -la"` I want to have set whenever any user brings up a terminal. Setting the alias in /etc/profile or in ~/.bashrc works for "ordinary" shells, but not for Konsole. How do I get it to work for Konsole?
User avatar
Ahmad Samir
Registered Member
Posts
127
Karma
0
OS

Re: Konsole variables

Sun Aug 23, 2009 5:15 pm
Setting aliases in ~/.bashrc works for konsole, did you open a new konsole window after editing .bashrc?

/etc/profile and ~/.bash_profile get executed once at login, so if you change them you have to logout then login.
lrhorer
Registered Member
Posts
7
Karma
0

Re: Konsole variables

Sun Aug 23, 2009 5:51 pm
It seems that /etc/profile is not being run at login, because changing the file does not establish the aliases for all users for Konsole. It works for regular x-term sessions. I want this to be for all users using Konsole. Secondly, it doesn't work for root to put it in /root/.bashrc. When I su to root in Konsole or an X-term, the alias is lost. This is where I need it most often.

Yes, I logged out and back in, and even rebooted several times.
User avatar
Ahmad Samir
Registered Member
Posts
127
Karma
0
OS

Re: Konsole variables

Sun Aug 23, 2009 6:25 pm
Editing /root/.bashrc works here when I su in konsole, also the system wide alias is set in /etc/profile.d/alias.sh (this is in Mandriva).

When you put
alias ll='ls -l' in your ~/.bashrc then open a konsole what does this say:
Code: Select all
type ll


I have this in ~/.bash_profile:
Code: Select all
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
   . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
lrhorer
Registered Member
Posts
7
Karma
0

Re: Konsole variables

Sun Aug 23, 2009 8:22 pm
I must have been on the wrong machine. I could have sworn I was on the right one. In any case, putting the alias in /etc/profile does not cause the alias to work for root, but putting it in /root/.bashrc does.
User avatar
Ahmad Samir
Registered Member
Posts
127
Karma
0
OS

Re: Konsole variables

Sun Aug 23, 2009 9:22 pm
I know what you mean, when I try something so many times and it doesn't work I become frustrated and forget I changed what/where/when :)
lrhorer
Registered Member
Posts
7
Karma
0

Re: Konsole variables

Tue Aug 25, 2009 1:19 am
Yeah, and lack of sleep doesn't help much, either.
sfitcs
Registered Member
Posts
7
Karma
0

Re: Konsole variables

Thu Feb 27, 2014 2:34 pm
Ahmad Samir wrote:Setting aliases in ~/.bashrc works for konsole, did you open a new konsole window after editing .bashrc?

/etc/profile and ~/.bash_profile get executed once at login, so if you change them you have to logout then login.


or instead of logging out do the following and they'll be available immediately:-
Code: Select all
. ~/.bash.rc
(shorthand for source /home/$user/.bash.rc)

Kind regards


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]