Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 17 of 17
No, use the existing one. You should keep the sourcing of /etc/bashrc....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044

    No, use the existing one. You should keep the sourcing of /etc/bashrc.

  2. #12
    Linux Newbie
    Join Date
    Aug 2005
    Posts
    214
    Quote Originally Posted by scm
    No, use the existing one. You should keep the sourcing of /etc/bashrc.
    Why that? He can just create empty .bashrc file in home dir, if not exists and add export command there. Ain't that true?

  3. #13
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    If he's happy to miss out on everything that /etc/bashrc sets up, yes. I'd advise including it, personally.

  4. #14
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    If he's happy to miss out on everything that /etc/bashrc sets up, yes. I'd advise including it, personally.

    Ah, I've just noticed satimis says he doesn't have a .bashrc file (how did that happen?). The supplied one (on FC2) looks like
    Code:
    # .bashrc
    # User specific aliases and functions
    # Source global definitions
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
    fi
    Do you have /etc/bashrc, satimis?

  5. #15
    Linux Newbie
    Join Date
    Aug 2005
    Posts
    214
    He may have /etc/basrch file, but I'm talking about .bashrc in home dir "/home/satmis/.bashrc". This file may exist or not, but you can create it and include your export commands there.

  6. #16
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,790
    Hi folks,

    Tks for your advice.

    bash-3.00$ ls -l /etc/bashrc
    Code:
    -rw-r--r--  1 root root 998 Aug 19 21:06 /etc/bashrc
    bash-3.00$ cat /etc/bashrc
    Code:
    # Begin /etc/bashrc
    # Written for Beyond Linux From Scratch
    # by James Robertson <jameswrobertson@earthlink.net>
    # updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>
    
    # Make sure that the terminal is set up properly for each shel
    
    if &#91; -f /etc/profile.d/tinker-term.sh &#93;; then
      source /etc/profile.d/tinker-term.sh
    fi
    
    # System wide aliases and functions.
    
    # System wide environment variables and startup programs should go into
    # /etc/profile.  Personal environment variables and startup programs
    # should go into ~/.bash_profile.  Personal aliases and functions should
    # go into ~/.bashrc
    
    # Provides a colored /bin/ls command.  Used in conjunction with code in
    # /etc/profile.
    
    alias ls='ls --color=auto'
    
    # Provides prompt for non-login shells, specifically shells started
    # in the X environment. &#91;Review the LFS archive thread titled
    # PS1 Environment Variable for a great case study behind this script
    # addendum.&#93;
    
    #export PS1="&#91;\u@\h \w&#93;\\$ "
    export PS1='\u@\h&#58;\w\$ '
    
    # End /etc/bashrc
    bash-3.00$ ls -al /home/satimis/ | grep .bashrc
    (No printout)
    bash-3.00$ ls -al /home/satimis/.bash*
    Code:
    -rw-------  1 satimis satimis 22191 Sep 19 18&#58;31 /home/satimis/.bash_history
    I can create /home/satimis/.bashrc. What will be its content? Only one line file?

    Or copy /root/.bashrc on it?

    B.R.
    satimis

  7. #17
    Linux Newbie
    Join Date
    Aug 2005
    Posts
    214
    Quote Originally Posted by satimis
    I can create /home/satimis/.bashrc. What will be its content? Only one line file?
    Yes, yes, yes you can! Yes you can create empty file and add one line to it as follows
    Code:
    export PATH=$PATH&#58;/my/path
    to add "/my/path" to existing PATH variable or
    Code:
    export PATH=/my/path
    to completely replace PATH with /my/path. Oh yes, the file must be named ".bashrc" and must be placed in your home dir (I hope it is /home/satimis). You can do it, now do it!

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •