Click to See Complete Forum and Search --> : bash and KDE question


sledge_hmr
01-29-2002, 12:08 PM
I am using Slackware 8.0. When I boot up the computer and am at the CLI, I have a bash prompt that looks like username@hostname:$ and I can use commands like dir. I used to have the same bash prompt and command set when I would launch a Konsole inside KDE 2.1, but after installing KDE 2.1 my Konsole is different. The prompt is bash-2.05$ and if I issue the dir command, I get bash: dir: command not found.

What's going on? How can I get my CLI bash prompt and command set when I use a Konsole inside KDE?

slapNUT
01-29-2002, 12:51 PM
It sounds like your .bashrc file was overwritten by KDE.

alias dir="ls"

Put that in .bashrc to get back the dir alias. The PS1 prompt would be something like this

PS1="\[\033[34m\][\u@\h:\w]$ "

That also goes in .bashrc

sledge_hmr
01-30-2002, 12:16 AM
I don't think that will do it. When I type dir at the CIS, I get different output then if I simply type ls. For instance, dir color codes directories, symbolic links, executable files, and regular files differently. This is the primary reason I prefer it to ls. Is there any way to get the KDE Konsole to behave like my default Slackware 8.0 CLI?

Dark Ninja
01-30-2002, 12:25 AM
Yeah. Same happens here. 'dir' does output in just normal black and white. 'ls' does things in blues and greens, etc. I prefer 'ls'


Dark Ninja

bdl
01-30-2002, 12:30 AM
More than likely 'dir' is just an alias thats sourced out of your ~/.bashrc or ~/.bash_profile file, something like this:

alias dir='ls --color'

It could be the difference between a login-shell and non-login shell. Someone correct me if I'm wrong on this, but normally xterms (and perhaps konsole) are non-login and therefore only read your ~/.bashrc file. Login-shells read your ~/.profile and/or ~/.bash_profile. Maybe your 'dir' alias and everything else you're missing is in ~/.bash_profile?? Just a thought..

[ 29 January 2002: Message edited by: bdl ]

knute
01-30-2002, 12:48 AM
Here's my aliases from my ~/.bashrc

# enable color support of ls and also add handy aliases

eval `dircolors`
alias ls='ls --color=auto '
alias ll='ls -lh'
alias la='ls -A'
alias l='ls -CF'
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias df='df -h'
alias startx='startx -- :4 -dpi 100 -depth 24'
alias jpig='jpig -X 80 -Y 60'
alias tf='tf -n'
alias cls='clear && welcome2l -xmasauto'
#alias cls='clear && linux_logo -u -L 1'
alias tvg='bin/tvguide > tv.html'
alias cms='cmatrix -labs'
alias big='/usr/sbin/fbset 1280x1024-60'
alias w3m='w3m -F'


hope they give you some ideas.

AdaHacker
01-30-2002, 06:23 PM
Originally posted by bdl:
<STRONG>Someone correct me if I'm wrong on this, but normally xterms (and perhaps konsole) are non-login and therefore only read your ~/.bashrc file. Login-shells read your ~/.profile and/or ~/.bash_profile. </STRONG>
Exactly right. Pretty much every terminal emulators around uses a non-login shell by default, which will read .bashrc, but not .bash_profile. Login shells will read both. I don't know about konsole (or whatever they call it), but most terms have an option to use a login session. In xterm and the like, it's -ls. You can also change this in ~/.Xdefaults or ~/.Xresources. I think the line
xterm.loginShell: true
should do the trick. (I'm not possitive of the syntax, though.)

sledge_hmr
01-31-2002, 01:52 AM
I could only find ~.bashrc and it only contains one line: alias od='od -t x1 -A x' What does this do exactly? If I add the the dir alias mentioned above, will my Konsole behave more like my CIS?

Thanks for all the help. I really appreciate it.

slapNUT
01-31-2002, 02:17 PM
Look in /etc/skel folder. There should be a copy of your original .bashrc file in there. Copy it to your user directory and chown if needed. That should correct the alias and the prompt.

evilcartman
01-31-2002, 04:00 PM
Same happened to me with Slack :)

My solution was using bash --login command then try dir