Author Topic: bash-3.00$: to rasputin~$: ?  (Read 14307 times)

0 Members and 1 Guest are viewing this topic.

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
bash-3.00$: to rasputin~$: ?
« on: September 04, 2006, 09:32:36 pm »
I want my term to tell me pwd in my display, not bash-3.00$ like it does.  I KNOW it's around here, but I can't find where whoever said how said it ><

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: bash-3.00$: to rasputin~$: ?
« Reply #1 on: September 04, 2006, 09:37:38 pm »
It depends how you are opening your terminal.  I think in KDE and Gnome there's an option, on the properties page for the shortcut to the terminal, or maybe on the terminal itself, to open the terminal as a "login shell".  Enable that. 

If you're directly running xterm, run it with the "-ls" parameter. 

Offline Ergot

  • 吴立峰 ^_^ !
  • x86
  • Hero Member
  • *****
  • Posts: 3724
  • I steal bandwidth. p_o
    • View Profile
Re: bash-3.00$: to rasputin~$: ?
« Reply #2 on: September 04, 2006, 09:42:18 pm »
I think I fixed it by adding "source /etc/profile" to ~/.bash_profile
Who gives a damn? I fuck sheep all the time.
And yes, male both ends.  There are a couple lesbians that need a two-ended dildo...My router just refuses to wear a strap-on.
(05:55:03) JoE ThE oDD: omfg good job i got a boner thinkin bout them chinese bitches
(17:54:15) Sidoh: I love cosmetology

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: bash-3.00$: to rasputin~$: ?
« Reply #3 on: September 04, 2006, 10:09:25 pm »
I think I fixed it by adding "source /etc/profile" to ~/.bash_profile
That's not the best way to do it, /etc/profile is run when a login shell is started, and bash_profile is run when bash is started. Those aren't the same thing, technically. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: bash-3.00$: to rasputin~$: ?
« Reply #4 on: September 04, 2006, 10:54:05 pm »
I want my term to tell me pwd in my display, not bash-3.00$ like it does.  I KNOW it's around here, but I can't find where whoever said how said it ><
Do
export PS1="[\u@\h \w]\$ "

EDIT: Can add it to ~/.bashrc too
An adorable giant isopod!

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: bash-3.00$: to rasputin~$: ?
« Reply #5 on: September 05, 2006, 01:41:41 am »
I always do

echo "source /etc/profile" > ~/.bashrc

Works fine for me. :)

Edit: Oh, also, anyone know how to do this with redhat linux?  I was messing around with it for a while last night and got it to work, but how do you make the shell update some variable with the working directory every time you change it?  I was doing pwd, but that is a static ~, obviously.
« Last Edit: September 05, 2006, 01:45:46 am by Sidoh »

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: bash-3.00$: to rasputin~$: ?
« Reply #6 on: September 05, 2006, 11:18:29 am »
I always do

echo "source /etc/profile" > ~/.bashrc

Works fine for me. :)

Edit: Oh, also, anyone know how to do this with redhat linux?  I was messing around with it for a while last night and got it to work, but how do you make the shell update some variable with the working directory every time you change it?  I was doing pwd, but that is a static ~, obviously.
You can probably do it the way I suggested, make the shell a login shell.  Either edit the shortcut, or run xterm with -ls. 

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: bash-3.00$: to rasputin~$: ?
« Reply #7 on: September 05, 2006, 12:41:46 pm »
I want this to work with ssh too.  I don't think that will work with it?  I found their login script (it's ~/.cshrc), and the variable defining the prompt syntax (set prompt=""). Do I need to fix that? :P

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: bash-3.00$: to rasputin~$: ?
« Reply #8 on: September 05, 2006, 12:59:03 pm »
With csh, things are different.  You should switch to bash (chsh) :)

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: bash-3.00$: to rasputin~$: ?
« Reply #9 on: September 05, 2006, 01:10:04 pm »
With csh, things are different.  You should switch to bash (chsh) :)

These are public lab computers they open SSH access to.  I'd love to switch to bash, since that's what I'm familiar with.  I've tried to use for, do, etc a few times and it throws errors!  Is there a way to change it for one user?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: bash-3.00$: to rasputin~$: ?
« Reply #10 on: September 05, 2006, 01:14:06 pm »
Generally, to change it for youself, run chsh. 

If you have admin access, you can do it yourself by editing /etc/passwd.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: bash-3.00$: to rasputin~$: ?
« Reply #11 on: September 05, 2006, 02:09:03 pm »
Generally, to change it for youself, run chsh. 

If you have admin access, you can do it yourself by editing /etc/passwd.

Where is chsh located?  I'm asuming its somewhere specified in PATH so I don't have to worry about it?

I don't have admin access.

Thanks, iago.

Just tried it.

Code: [Select]
[mullins@grays ~]$ chsh
chsh: can only change local entries; use ypchsh instead.
[mullins@grays ~]$ locate ypchsh
/usr/share/man/man1/ypchsh.1.gz
/usr/share/man/ja/man1/ypchsh.1.gz
/usr/bin/ypchsh
[mullins@grays ~]$ ypchsh
Changing NIS account information for mullins on bach.cs.colostate.edu.
Please enter password:

Changing login shell for mullins on bach.cs.colostate.edu.
To accept the default, simply press return. To use the
system's default shell, type the word "none".
Login shell [/usr/local/bin/tcsh]: /usr/bin/ypchsh
Error while changing the login shell.
The login shell has not been changed on bach.cs.colostate.edu.

Am I doint something incorrectly?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: bash-3.00$: to rasputin~$: ?
« Reply #12 on: September 05, 2006, 02:33:28 pm »
Login shell [/usr/local/bin/tcsh]: /usr/bin/ypchsh
Error while changing the login shell.



At that point, you want to give it the path to bash.  For a list of installed shells + paths, check /etc/shells.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: bash-3.00$: to rasputin~$: ?
« Reply #13 on: September 05, 2006, 02:38:35 pm »
Oh!  Haha.

Code: [Select]
[mullins@grays ~]$ grep "bash" /etc/shells
/bin/bash
/usr/local/bin/bash
[mullins@grays ~]$ ypchsh
Changing NIS account information for mullins on bach.cs.colostate.edu.
Please enter password:

Changing login shell for mullins on bach.cs.colostate.edu.
To accept the default, simply press return. To use the
system's default shell, type the word "none".
Login shell [/usr/local/bin/tcsh]: /usr/local/bin/bash
Error while changing the login shell.
The login shell has not been changed on bach.cs.colostate.edu.

[mullins@grays ~]$ ypchsh
Changing NIS account information for mullins on bach.cs.colostate.edu.
Please enter password:

Changing login shell for mullins on bach.cs.colostate.edu.
To accept the default, simply press return. To use the
system's default shell, type the word "none".
Login shell [/usr/local/bin/tcsh]: /bin/bash
Error while changing the login shell.
The login shell has not been changed on bach.cs.colostate.edu.

Am I doing something incorrectly?

Oh, also:

Code: [Select]
[mullins@grays ~]$ /usr/local/bin/bash
cat: /etc/HOSTNAME: No such file or directory
mullins@grays:~$                   

:o

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: bash-3.00$: to rasputin~$: ?
« Reply #14 on: September 05, 2006, 03:46:18 pm »
Oh!  Haha.

Code: [Select]
[mullins@grays ~]$ grep "bash" /etc/shells
/bin/bash
/usr/local/bin/bash
[mullins@grays ~]$ ypchsh
Changing NIS account information for mullins on bach.cs.colostate.edu.
Please enter password:

Changing login shell for mullins on bach.cs.colostate.edu.
To accept the default, simply press return. To use the
system's default shell, type the word "none".
Login shell [/usr/local/bin/tcsh]: /usr/local/bin/bash
Error while changing the login shell.
The login shell has not been changed on bach.cs.colostate.edu.

[mullins@grays ~]$ ypchsh
Changing NIS account information for mullins on bach.cs.colostate.edu.
Please enter password:

Changing login shell for mullins on bach.cs.colostate.edu.
To accept the default, simply press return. To use the
system's default shell, type the word "none".
Login shell [/usr/local/bin/tcsh]: /bin/bash
Error while changing the login shell.
The login shell has not been changed on bach.cs.colostate.edu.

Am I doing something incorrectly?

Oh, also:

Code: [Select]
[mullins@grays ~]$ /usr/local/bin/bash
cat: /etc/HOSTNAME: No such file or directory
mullins@grays:~$                   

:o

try executing:
which bash
or
whereis bash

Chances are, it might not have bash.

EDIT: Oh yeah, try executing ps to see if you're running bash.
It might have bash on some remote mount ... I know, for example SDF has some of their utilities mounted on NFS and that to chsh you have to ssh to their file server to do it.
« Last Edit: September 05, 2006, 03:48:43 pm by nslay »
An adorable giant isopod!