LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   can't the file bashrc (https://www.linuxquestions.org/questions/linux-software-2/cant-the-file-bashrc-257083/)

Paxmaster 11-19-2004 09:48 PM

can't the file bashrc
 
i have notice that slackware doesn't have bashrc in /etc and bash_profile, i used to have fc2 on my laptop but i have format it and install slackware10,
and in fc2 i have adjust DIR_COLOR and it work great, but now i am trying to do the same, it work in runlevel 3 and it don't work in runlevel

student04 11-20-2004 12:19 AM

What exactly is your question?

daihard 11-20-2004 01:40 AM

If you want a sample DIR_COLOR or LS_COLOR, here's mine:
Code:

LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:
bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:
*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:
*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.i386.rpm=01;31:*.i586.rpm=01;31:
*.src.rpm=01;30:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:
*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.png=01;35:'


Paxmaster 11-20-2004 01:56 PM

hi i can't find bashrc in /etc
thanks daihard for LS_COLOR but i didn't it yet try it because i can't find bashrc file, my bash prompt is 2.5, sholuld i upgrade it

daihard 11-20-2004 02:06 PM

Quote:

Originally posted by Paxmaster
hi i can't find bashrc in /etc
thanks daihard for LS_COLOR but i didn't it yet try it because i can't find bashrc file, my bash prompt is 2.5, sholuld i upgrade it

You can simply create your own bashrc file as ~/.bashrc. The bash shell reads it in automatically. As for the default /etc/bashrc, I don't think it's a problem not to have it. Mine is as simple as this:
Code:

# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile
PS1="[\u@\h \W]\\$ "

alias which="type -path"


IBall 11-20-2004 07:52 PM

My slackware box has a /etc/profile but no /etc/bashrc.

Bash has three diffierent files that it reads at startup - profile, bash_profile and bashrc. Either one may be used, and they are all equally valid

--Ian

Paxmaster 11-20-2004 09:30 PM

very werid going on
 
my console in runlevel act differnt then in runlevel 5, I have fix my PS1 in runlevel 5 but not in console, other hand i have fix DIR_COLOR in console but not in xwindow. Looks like something is interfering with my console, and my bash in x window the LS_COLOR is not working.

daihard 11-20-2004 10:30 PM

Re: very werid going on
 
Quote:

Originally posted by Paxmaster
my console in runlevel act differnt then in runlevel 5, I have fix my PS1 in runlevel 5 but not in console, other hand i have fix DIR_COLOR in console but not in xwindow. Looks like something is interfering with my console, and my bash in x window the LS_COLOR is not working.
Did you make sure you specified "--color=auto" or something like that with 'ls'?

Paxmaster 11-22-2004 10:19 AM

i have edit the menu and i add this aterm -tr -ls, now some reason it work now and i could see color in runlevel 5 could any tell wat is the propose of -ls

In the file .bashrc here what look like




if [ "$TERM" = "linux" ]
then
#we're on the system console or maybe telnetting in
export PS1="\e[32;1m[Paxmaster>\t]\e[31;1m"
else
#we're not on the console, assume an xterm
export PS1="\[\e]2;\u@\H\w\a\e[34;1m\]\u\[\e[34;m\]@\h:\[\e[33m\]\W\[\e[32m\$

fi

but now i have one more problem when I open a bash prompt above is a saying but i can't read it, because is it black letters and my screen is black, and also when i try to edit a file same thing happen the letter is back how could i fix this.


now i almost fix the problem by doing this i change this export PS1="\[\e]2;\u@\H\w\a\e[34;1m\]\u\[\e[34;m\]@\h:\[\e[33m\]\W\[\e[32m\$ to export PS1="\[\e]2;\u@\H\w\a\e[34;1m\]\u\[\e[34;m\]@\h:\[\e[33m\]\W\[\e[31;1m>"

this mean whenever i type at command it always show red, but other hand when type man
<filename> the letter is black how could i change it to white or other color

if some one who use slackware they will know what i am taking about the saying appear

thanks

jules_fraser 01-02-2005 06:51 AM

Whenever I log out of SSH, I find that my colors are all gone. I have to keep "source .bashrc" before I begin my session. How can I make this permanent?

jules_fraser 01-02-2005 06:58 AM

All ok now, have added these lines to:

Code:

.bash_profile


All times are GMT -5. The time now is 08:07 PM.