Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
10-16-2005, 08:33 AM
|
#1
|
Member
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440
Rep:
|
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?
|
|
|
10-16-2005, 09:57 AM
|
#2
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Rep:
|
Create a ~/.bash_profile:
if [ -f ~/.bashrc ]; then
. ~/bashrc # --> Read bashrc, if present.
fi
|
|
|
10-16-2005, 09:21 PM
|
#3
|
Member
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440
Original Poster
Rep:
|
~/.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 ---
|
|
|
10-16-2005, 09:46 PM
|
#4
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
what is in your " ~/.bashrc " ?
egag
|
|
|
10-17-2005, 01:18 AM
|
#5
|
Member
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440
Original Poster
Rep:
|
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
|
|
|
10-17-2005, 03:22 AM
|
#6
|
Member
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879
Rep:
|
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.
|
|
|
10-17-2005, 08:12 AM
|
#7
|
Member
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440
Original Poster
Rep:
|
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
|
|
|
06-13-2006, 12:31 AM
|
#8
|
Member
Registered: Dec 2005
Location: ~
Distribution: Slackware -current
Posts: 467
Rep:
|
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
|
|
|
06-13-2006, 04:26 AM
|
#9
|
Member
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498
Rep:
|
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.
|
|
|
06-13-2006, 10:44 AM
|
#10
|
Member
Registered: Dec 2004
Location: Hyderabad, India
Distribution: Slackware 13, Ubuntu 12.04
Posts: 440
Original Poster
Rep:
|
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 :-)
|
|
|
All times are GMT -5. The time now is 12:10 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|