News:

Facebook killed the radio star. And by radio star, I mean the premise of distributed forums around the internet. And that got got by Instagram/SnapChat. And that got got by TikTok. Where the fuck is the internet we once knew?

Main Menu

bash-3.00$: to rasputin~$: ?

Started by rabbit, September 04, 2006, 09:32:36 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

rabbit

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 ><

iago

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. 

Ergot

I think I fixed it by adding "source /etc/profile" to ~/.bash_profile
Quote from: Newby on February 26, 2006, 12:16:58 AM
Who gives a damn? I fuck sheep all the time.
Quote from: rabbit on December 11, 2005, 01:05:35 PM
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

iago

Quote from: Ergot on September 04, 2006, 09:42:18 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. 

nslay

Quote from: rabbit 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 ><
Do
export PS1="[\u@\h \w]\$ "

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

Sidoh

#5
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.

iago

Quote from: Sidoh 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.
You can probably do it the way I suggested, make the shell a login shell.  Either edit the shortcut, or run xterm with -ls. 

Sidoh

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

iago

With csh, things are different.  You should switch to bash (chsh) :)

Sidoh

Quote from: iago on September 05, 2006, 12:59:03 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?

iago

Generally, to change it for youself, run chsh. 

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

Sidoh

Quote from: iago 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.

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.

[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?

iago

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.

Sidoh

Oh!  Haha.

[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:

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


:o

nslay

#14
Quote from: Sidoh on September 05, 2006, 02:38:35 PM
Oh!  Haha.

[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:

[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.
An adorable giant isopod!