SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
for some reason my .bashrc doesn't have any effect.
Even when after login I do
Code:
. ~/.bashrc
the aliases in that file are still not recognised
A related thing probably is that recently (after major updates to slack-current when I had been away for 2 weeks) I needed to adjust the permissions of my ~/ dir. So I did a quick and dirty
Code:
chown -R leon:users ~/
If anyone has a clue where to start checking what can be wrong here I would be very happy to hear about it! Please let me know if I should provide more info.
First, updates to Slackware did not touch your /home directory - don't blame Slackware.
Second, post the contents of $HOME/.bashrc here.
First, I never blamed Slackware for anything. That's why I called my initial solution 'quick and dirty'.
Second, here's ~/.bashrc
Code:
# .bashrc
# User specific aliases and functions
PATH=$PATH:$HOME/cxoffice/bin:$HOME/bin:/sbin:/usr/bin:/usr/local/bin/:/opt/open
office.org2.2/program
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Source bash_completion definitions (Added 01.11.06)
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
LYNX_CFG=~/.lynx/lynx.cfg; export LYNX_CFG
export ADOBE_SVG_VIEWER_PATH=/usr/local/adobesvg-3.0
alias reboot='sudo /sbin/reboot'
alias halt='sudo /sbin/halt'
alias mcd='mount /mnt/cdrom/ && cd /mnt/cdrom/'
alias ucd='cd ~ && umount /mnt/cdrom/ && eject'
alias musb='mount /mnt/usb && cd /mnt/usb'
alias uusb='cd ~ && umount /mnt/usb'
alias mp3blaster="cd /vfat && mp3blaster"
alias startxtv="startx -- -config xorg.conf.tv"
alias atitvout='sudo /usr/local/sbin/atitvout'
alias nice='sudo /usr/bin/nice'
alias df='df --sync'
alias ln='ln -si'
alias ssh_brox='ssh leon@***.***.***'
alias ssh_brox_X='ssh -Y leon@***.***.***'
I wonder why it doesn't work even when you source it manually. If you copy .bashrc to, say, temprc and do a source temprc, does it work?
If you manually define one of the aliases on a terminal, does that work?
Are only the aliases not working, or is it everything ($ADOBE_SVG_VIEWER_PATH etc)?
Why the defensive attitude? Shouldn't you be interested and (help him) understand why something changed instead?
Shouldn't you read *everything* written by *both* people instead of just one line by me?
The OP wrote:
Quote:
Originally Posted by LJSBrokken
A related thing probably is that recently (after major updates to slack-current when I had been away for 2 weeks) I needed to adjust the permissions of my ~/ dir.
Perhaps it was not intended that way, but that seems to imply that the updates were somehow responsible. The OP might very well know that this is not the case (as maybe the comment was simply an afterthought), but others reading this thread may not be aware, so I *will* clarify that.
With that said, I *am* interested in the problem and made such clear by asking for the contents of $HOME/.bashrc
I don't see anything wrong with $HOME/.bashrc - this is odd.
Post the following:
Code:
echo $SHELL
I fully understand your pointing out that it shouldn't be blamed on Slackware. I just wanted to clarify that I hadn't intended to do so, and I added that last line because the obvious next question would be "what has recently been changed?". I appreciate your support in sorting this weird thing out.
Code:
leon@shpritsz:~$ echo $SHELL
/bin/bash
And, as suggested by arungoodboy:
Copying ~/.bashrc to another dir and source it from there doesn't help.
If I define an alias from a console it works well.
It's not just aliases that aren't picked up, also other definitions, for example:
Maybe the problem is not in the .bashrc file but in the source command itself. If the bash version installed on your system has the command source (along with ".") you can try
Code:
source ~/.bashrc
if it works you can try to discover why the "." command is not working properly. Maybe it has been erroneously aliased to something else?
I fully understand your pointing out that it shouldn't be blamed on Slackware. I just wanted to clarify that I hadn't intended to do so, and I added that last line because the obvious next question would be "what has recently been changed?".
Yes, that would have been asked. It was a misunderstanding - all's well that ends well. :-)
However, I'm not convinced that this is going to end well... :/
Quote:
Code:
leon@shpritsz:~$ echo $SHELL
/bin/bash
Okay, that's good.
Quote:
And, as suggested by arungoodboy:
Copying ~/.bashrc to another dir and source it from there doesn't help.
If I define an alias from a console it works well.
It's not just aliases that aren't picked up, also other definitions, for example:
I have absolutely no idea where to look next. I've copied your .bashrc from above verbatim into a test file, and it sources correctly and all the aliases and environment settings are applied.
What exit code is returned after sourcing .bashrc?
Hmm, a bit of update (thanks to amrit for the tip):
From bash(1):
Code:
RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than the standard shell. It behaves identically to bash with the exception that the following are disallowed or not performed:
· changing directories with cd
· setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV
· specifying command names containing /
· specifying a file name containing a / as an argument to the . builtin command
· Specifying a filename containing a slash as an argument to the -p option to the hash builtin command
· importing function definitions from the shell environment at startup
· parsing the value of SHELLOPTS from the shell environment at startup
· redirecting output using the >, >|, <>, >&, &>, and >> redirection operators
· using the exec builtin command to replace the shell with another command
· adding or deleting builtin commands with the -f and -d options to the enable builtin command
· Using the enable builtin command to enable disabled shell builtins
· specifying the -p option to the command builtin command
· turning off restricted mode with set +r or set +o restricted.
These restrictions are enforced after any startup files are read.
Are you perhaps executing bash with the -r flag?
Even so, I don't think this would prevent everything in your .bashrc from working - just some of it.
Add some echo statements in there (at the top, later on, perhaps even after every line) to see if it's even being looked at, and if so, how far it gets.
YES! That's the culprit! Reverting to bash-3.1.017-i486-2 from slackware/a solved the issue!
Well, that's a new one. I've had the bash package from /testing installed here for quite some time -- however, I use ksh as my regular shell, so maybe I just haven't used the new bash enough.
I guess that's *another* reason for new bash to be in /testing still...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.