LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-25-2007, 10:39 AM   #1
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Rep: Reputation: 90
~/.bashrc and/or permissions problem


Hi all,

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.

Cheers, Leon.
 
Old 10-25-2007, 11:20 AM   #2
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
First, updates to Slackware did not touch your /home directory - don't blame Slackware.
Second, post the contents of $HOME/.bashrc here.
 
Old 10-26-2007, 02:58 AM   #3
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Original Poster
Rep: Reputation: 90
Quote:
Originally Posted by rworkman View Post
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@***.***.***'
Cheers, Leon.
 
Old 10-26-2007, 03:53 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by rworkman View Post
First, updates to Slackware did not touch your /home directory - don't blame Slackware.
Why the defensive attitude? Shouldn't you be interested and (help him) understand why something changed instead?
 
Old 10-26-2007, 06:10 AM   #5
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
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)?
 
Old 10-26-2007, 08:05 AM   #6
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by unSpawn View Post
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 View Post
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
 
Old 10-26-2007, 08:09 AM   #7
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
I don't see anything wrong with $HOME/.bashrc - this is odd.
Post the following:
Code:
echo $SHELL
 
Old 10-26-2007, 09:21 AM   #8
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Original Poster
Rep: Reputation: 90
Quote:
Originally Posted by rworkman View Post
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:
Code:
leon@shpritsz:~$ export ADOBE_SVG_VIEWER_PATH=""
leon@shpritsz:~$ echo $ADOBE_SVG_VIEWER_PATH

leon@shpritsz:~$ . .bashrc 
leon@shpritsz:~$ echo $ADOBE_SVG_VIEWER_PATH

leon@shpritsz:~$
Cheers, Leon.
 
Old 10-26-2007, 09:40 AM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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?
 
Old 10-26-2007, 09:42 AM   #10
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by LJSBrokken View Post
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:
Code:
leon@shpritsz:~$ export ADOBE_SVG_VIEWER_PATH=""
leon@shpritsz:~$ echo $ADOBE_SVG_VIEWER_PATH

leon@shpritsz:~$ . .bashrc 
leon@shpritsz:~$ echo $ADOBE_SVG_VIEWER_PATH

leon@shpritsz:~$
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?
Code:
. $HOME/.bashrc
echo $?
 
Old 10-26-2007, 09:55 AM   #11
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
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.
 
Old 10-26-2007, 11:35 AM   #12
simcox1
Member
 
Registered: Mar 2005
Location: UK
Distribution: Slackware
Posts: 794
Blog Entries: 2

Rep: Reputation: 30
I don't suppose you accidentally installed the bash package in /testing, which was one of the upgrades to current recently?
 
Old 10-27-2007, 02:30 PM   #13
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Original Poster
Rep: Reputation: 90
Quote:
Originally Posted by simcox1 View Post
I don't suppose you accidentally installed the bash package in /testing, which was one of the upgrades to current recently?
YES! That's the culprit! Reverting to bash-3.1.017-i486-2 from slackware/a solved the issue!

Thanks all for the input!

Cheers, Leon.
 
Old 10-27-2007, 11:32 PM   #14
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by LJSBrokken View Post
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting path: /etc/profile, /etc/bashrc or ~/.bashrc Swakoo Linux - General 1 08-07-2007 10:59 PM
Problem running old software under .bashrc wollery Linux - Enterprise 3 12-15-2006 09:44 AM
problem after editing .bashrc ashley75 Linux - General 3 10-20-2004 05:49 PM
Problem with bashrc file johnstv3 Red Hat 10 02-26-2004 02:09 AM
.bashrc problem davis2199 Linux - Software 1 09-02-2003 03:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration