Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File associations?

Status
Not open for further replies.

tech84

Technical User
May 18, 2000
126
US
Hi,

I recently installed Netscape 7 on my Sun Ultra 2 box running Solaris 8, patch level 17, but I left Netscape 4.6 on there also. How do I associate all html files, and Netscape executions (such as just typing "netscape" in the terminal window) with the newer version? Right now, I have to type in the absolute path to the new executable.

This is so easy to do in Window$, but I'm at a loss here!

Thanks! Mike
[morning]
 
you'll have to change the dtaction stuff in your .dt/types directory, or in the global dt types directory.
 
Oh man... that's way over my head. I think I'll just keep typing in the absolute path for now.

Thanks, though! Mike
[morning]
 
Why not either add the netscape to your PATH in your .profile (PATH=${PATH}:/my/netscape/dir) or define an alias (alias netscape='/my/netscape/dir/netscape')?

That won't do the file association stuff though. Annihilannic.
 
Boy, I can't get anything to work on this crazy system. Either that, or it's just a case of I don't know what the heck I'm doing. Ha!

So I decided to go for the alias option. I put alias='/opt/Netscape/netscape' in my .profile, but it doesn't work! I've tried logging out and back in, and still nothing. I know the command is correct, because I can type it on the command line and it works. Is there a certain place in the .profile that I need to place the alias command? At the end after the last "fi"?

Sorry to be such a pain! Mike
[morning]
 
alias works in [ck]sh
not on sh
put your alias in .cshrc if you use csh
.kshrc ksh -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Did you put alias=/opt... or alias netscape=/opt... in your .profile? (I'm not sure whether the typo was in your posting or your .profile as well!)

At the end of your .profile should be fine. Typing alias on its own will show you whether it's set. Annihilannic.
 
Yeah, my typo was in the post, not in the .profile. Good eye!

I'm working in the bash shell. I've gotten aliases to work in this shell before, so I don't know what the deal is. Mike
[morning]
 
You're using bash, so presumably you have a .bash_profile which will be executed instead of .profile? Have you tried adding your alias to .bash_profile? HTH.
 
I have a .bash_history, but no .bash_profile. Can I just rename my .profile to .bash_profile?

Thanks Mike
[morning]
 
Mike,

this is from the man pages for bash:

" When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior."

I think in these circumstances, you would be better advised to put the alias in /etc/profile so that it is picked up regardless of what shell is being used. Cheers.
 
Thanks for the bash tip!

I've added the alias line to the /etc/profile already, and it still doesn't work! I don't know what the deal is. I just stuck it in at the bottom of the file. Maybe I need to read up more on the /etc/profile context or something. Mike
[morning]
 
What happens when you type alias on its own after logging in? Does your entry not appear at all? Annihilannic.
 
don't put user's preferences in global files like /etc/profile .... edit $HOME/files like
.bashrc

#!/bin/bash
alias a='alias|more'
alias dn='domainname'
alias hn='hostname'
... -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
When I type alias after logging in, I get nothing.

I'm afraid I don't know anything about .bashrc. Can I just add the #!/bin/bash, followed by my aliases, just like you have there? I'll give that a try.

Thanks! Mike
[morning]
 
I did as I said, and created a .bashrc in my home directory, put the alias in there, and it worked!

Thanks so much! Mike
[morning]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top