LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-16-2005, 08:33 AM   #1
adityavpratap
Member
 
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440

Rep: Reputation: 32
problem with bash


Hi,
The tweaks that I have applied to .bashrc are not automatically applied when I boot into the system. I have to manually give $. .bashrc each time I logon.
Any idea how I can have my favourite settings applied each time I logon?
 
Old 10-16-2005, 09:57 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649

Rep: Reputation: 148Reputation: 148
Create a ~/.bash_profile:

if [ -f ~/.bashrc ]; then
. ~/bashrc # --> Read bashrc, if present.
fi
 
Old 10-16-2005, 09:21 PM   #3
adityavpratap
Member
 
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440

Original Poster
Rep: Reputation: 32
~/.bash_profile exists, but the relevant lines were commented out. Even after uncommenting them the problem persists. Here is a listing of .bash_profile -


# ~/.bash_profile: executed by bash(1) for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/login.defs
#umask 022

# the rest of this file is commented out.

# set variable identifying the chroot you work in
#if [ -f /etc/debian_chroot ]; then
# debian_chroot=$(cat /etc/debian_chroot)
#fi

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# set PATH so it includes user's private bin if it exists
#if [ -d ~/bin ] ; then
# PATH=~/bin:"${PATH}"
#fi

# do the same with MANPATH
#if [ -d ~/man ]; then
# MANPATH=~/man:"${MANPATH}"
# export MANPATH
#fi
# --- kcmrscp::start [Do not edit these lines.] ---
export LOCPATH=/home/aditya/.rscp/locales-bin/
export LANG=en_IN
export LANGUAGE=en_US
export LC_ALL=en_IN
alias ls='ls -lh'
# --- kcmrscp::end ---
 
Old 10-16-2005, 09:46 PM   #4
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
what is in your " ~/.bashrc " ?

egag
 
Old 10-17-2005, 01:18 AM   #5
adityavpratap
Member
 
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440

Original Poster
Rep: Reputation: 32
Nothing much. However here it is -

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# Add ~/bin/ to the PATH
export PATH="$PATH:$HOME/bin"
# If running interactively, then:
if [ "$PS1" ]; then

# don't put duplicate lines in the history. See bash(1) for more options
# export HISTCONTROL=ignoredups

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
#shopt -s checkwinsize

# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval `dircolors -b`
#User defined aliases
alias ls='ls -lh --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
fi

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

# set a fancy prompt
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

# If this is an xterm set the title to user@host:dir
case $TERM in
xterm*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
 
Old 10-17-2005, 03:22 AM   #6
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
Perhaps Slackware doesn't like (or understand)
Quote:
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
When I used Debian, I always deleted .bashrc and made my own.Why not just make one that says

Code:
export PATH="$PATH:$HOME/bin"
PS1='\u@\W $ '
alias ls='ls --color'
- and say that's it?

Last edited by mjjzf; 10-17-2005 at 03:28 AM.
 
Old 10-17-2005, 08:12 AM   #7
adityavpratap
Member
 
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440

Original Poster
Rep: Reputation: 32
Got it

Got it going this time.
As suggested by OSourceDiplomat, I first copied .bashrc to .bashrc_backup. -
then I added the following three lines -

export PATH="$PATH:$HOME/bin"
PS1='\u.\h@\W $ '
alias ls='ls --color'

Rebooted. But still couldn't get it right. So I checked .bash_profile, there I found this line -


alias ls='ls -lh'


this was conflicting with the alias in .bashrc. So I commented it out and rebooted. This time I got it right. My stupidity
 
Old 06-13-2006, 12:31 AM   #8
MannyNix
Member
 
Registered: Dec 2005
Location: ~
Distribution: Slackware -current
Posts: 467

Rep: Reputation: 55
Quote:
Originally Posted by titopoquito
Create a ~/.bash_profile:

if [ -f ~/.bashrc ]; then
. ~/bashrc # --> Read bashrc, if present.
fi
Thank you, worked fine, just check 3rd reference to bashrc needs a dot "." .bashrc
 
Old 06-13-2006, 04:26 AM   #9
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
Quote:
Originally Posted by adityavpratap
Got it going this time.
As suggested by OSourceDiplomat, I first copied .bashrc to .bashrc_backup. -
then I added the following three lines -

export PATH="$PATH:$HOME/bin"
PS1='\u.\h@\W $ '
alias ls='ls --color'

Rebooted. But still couldn't get it right. So I checked .bash_profile, there I found this line -


alias ls='ls -lh'


this was conflicting with the alias in .bashrc. So I commented it out and rebooted. This time I got it right. My stupidity
Heh, you don't need to restart Linux system at all, only at kernel change. This is not MS Windows ;-) It would be enough to relogin to apply changes in bash startup scripts.
 
Old 06-13-2006, 10:44 AM   #10
adityavpratap
Member
 
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by dunric
Heh, you don't need to restart Linux system at all, only at kernel change. This is not MS Windows ;-) It would be enough to relogin to apply changes in bash startup scripts.
Agreed. Another of my stupidities :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
a problem about bash naihe2010 Linux - Enterprise 1 10-15-2005 12:06 PM
Problem with BASH Pheidon Linux From Scratch 5 06-24-2005 03:34 AM
Bash Problem krock923 Programming 3 01-02-2005 02:40 PM
bash problem cL4YmAN Linux - Newbie 1 06-07-2004 02:32 PM
bash problem Vincent Slackware 2 10-30-2003 06:01 AM

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

All times are GMT -5. The time now is 12:10 AM.

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