|
|
#1 |
|
Major Leaguer
Join Date: May 2002
Location: atl, ga, usa
Posts: 356
|
"Unknown terminal type network!" at 2nd login
I'm using OSX Panther 10.3, Terminal, and of course the new default shell, bash.
When I login a 2nd time in the same Terminal window [for example, to test an alias I am creating in .bash_login], I can't run pico. I get this error message: "Unknown terminal type network!" Now, the first time I open a Terminal window, I'm already logged in, and apparently bash is satisfied that it knows my terminal type, because I can run pico sans problem. But why not after logging in on top of my first shell? And how can I fix it? Please go slowly--remember this is the Unix Newcomers forum! I'm not a newcomer, but a perpetual newbie where *nix is concerned. Thanks, osxpounder |
|
|
|
|
|
#2 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
please describe "login a 2nd time in the same Terminal window"
|
|
|
|
|
|
#3 | |||||||||||||||||||
|
Major Leaguer
Join Date: May 2002
Location: atl, ga, usa
Posts: 356
|
Sorry. I am already using a Terminal window, and, at the command prompt, I type "login", and login with the same user and passwd. I do this to test a new alias, for example. Thanks for asking. |
|||||||||||||||||||
|
|
|
|
|
#4 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
try:
login -fp or bash --login or command-N |
|
|
|
|
|
#5 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
You shouldn't do a 'login' when you are already logged in. As you found out, it doesn't work - this seems to be a bug but doing 'login' is something you don't usually want to do anyway.
To test your changes to your .profile or .bashrc files, you could start a new shell via the command: bash This would start a new shell running inside your current shell. Not good if you do this a lot since you would build up a bunch of shells withing shells. Better would be to close your current Terminal window and then open a new one. The new one will do a login and hence run all your 'dot' files. Alternately, you could just "source" the 'dot' files that you have changed. In bash, you do this with the dot command - a single dot (.) followed by the name of the file. For example: . ~/.profile The downside of that is that tehre might be some things in your .profile etc that you don't wnat to do twice (e.g. adding to a PATH). For this reason, I usually keep my aliases & functions in a separate file (e.g. .bash_aliases) so that I can source this file whenever I want to update it. |
|
|
|
|
|
#6 |
|
Major Leaguer
Join Date: May 2002
Location: atl, ga, usa
Posts: 356
|
Thanks!
So, if I wanted to move my aliases to .bash_aliases, would I have to do something to make sure that this file of aliases is used at every login? I'm guessing, based on what I've read here, that I could move my aliases to .bash_aliases, then add a line to my .bash_login file that reads: .~/.bash_aliases ... so that every time I login, the aliases get loaded [if that's the right verb for it]. I also assume that I'll have to chmod these .bash_* files to make them executable by me. Am I right? If not, your suggestions welcome on the best way to ensure that my aliases are always available to me. I like the idea of separating them into a separate file with "aliases" in the name, for the sake of convenience in the future [after I've forgotten where the aliases go again...] |
|
|
|
|
|
#7 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
always leave yourself a shell window to fix what might be broken by edits in the shell startup scripts that may error and prevent you from being able to login
![]() echo hayne about breaking out the shell defs into their own files for easy editing and testing... .bash_aliases .bash_cdvars .bash_completion .bash_functions .bash_history .bash_hostfile .bash_logout .bash_profile .bashrc another beauty here is adding aliases or functions can be done easily by defining a function to append to the appropriate file: Code:
mkalias ()
{
local name=$1 value="$2";
echo alias $name=\'$value\' >>~/.bash_aliases;
eval alias $name=\'$value\';
alias $name
}
$ mkalias aliasName 'onerous command line that i finally got working and never want to have to type again' osxpounder: right, source the ~/.bash_aliases file in .bashrc: Code:
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases ; fi Last edited by mervTormel; 12-17-2003 at 12:30 PM. |
|
|
|
![]() |
|
|