[SPARCbook] Help - THANKS

sparcbook at sunhelp.org sparcbook at sunhelp.org
Thu Dec 14 13:02:52 CST 2000



To sunder at sunder.net:

Thanks, I believe that in the if statement, $0 should be $SHELL.  Here in
the office I have a machine with Linux and when I used $0 in a test
program, it returned the name of the program while $SHELL returned
/bin/bash.  I will find out how Solaris responds this evening.

To Russell F Maginnis:

BTW, the URL "www.tadpole.com/support-trdi/techtips/" does not seem to
exist??  It may have been discontinued or may be temporarily "broken"???
... but www.kempston.net appears to be very useful.

Oscar Farah





sunder <sunder at sunder.net>
Sent by: sparcbook-admin at sunhelp.org
12/14/2000 12:58 PM
Please respond to sparcbook


        To:     sparcbook at sunhelp.org
        cc:
        Subject:        Re: [SPARCbook] Help - THANKS


Oscar.G.Farah at census.gov wrote:
>
> Thanks to sunder at sunder.net, I have "bash" installed and working and
> Netscape working properly as well; and thanks to Russell, I have
> downloaded a lot of interesting information from http://www.kempston.net which
I
> will use to try to get the modem working; in addition I found out
> in these downloaded files that the PATH variable is defined at boot by
the
> file ".dtprofile" located in the home directory.
>
>  As I do not have my laptop here; it is at home; I hope that this is
> correct because I would like to modify the default path.
>
> Does ".dtprofile" also contain the selection of which shell to use at
> boot?  I would like to use the bash shell exclusively.  Thanks

Sadly, no.  At least not with my experimentation.  If you use CDE (the
Common Desktop Environment which uses .dtprofile) all sorts
of weird things happen to CDE if you exec or just call bash from
.dtprofile.

Rather, you should just set the shell field in the passwd file.  Use the
vipw command to do this. Change /bin/csh or /bin/sh to
/usr/local/bin/bash for the account you want, then exit.

If you don't know how to use vi, do a search on google.  Basically, the
cursor keys will work fine.  Use i to enter insert mode
(there are all sort of other keys.) Press ESC to get out.  If you're not
in insert mode, you can use x to delete.  When you're done
editing the file, press ESC, type in :x! and hit enter.  If you made an
error and don't want to mess up the file, use ESC :q! will
exit and quit.

I don't think Solaris 2.6 has a chsh command sadly.

But, there is another trick you can do.  If your account is using csh, you
can change the .login and .cshrc files on the last line
to say "exec bash" - it might work.  It's worth trying.

If you know shell programming you can add something like this to .profile.
(This is off the top of my head, so it's likely buggy.)

First, go into bash. Then type in echo $0. This should print either bash
or /usr/local/bin/bash.  The only box I have available now
as I type this (OpenBSD says "-bash")  Replace the bash in the if
statement to this.

Put this line as the last line of your .profile

if [ "$0" != "-bash" ]; then exec /usr/local/bin/bash; fi

You might need to remove the exec in some cases.  CDE is a bit funny about
changing the shell.  So again, don't do this to the root
account.  That way, if you get hosed, you can at least login as root and
fix it. :)


--
----------------------Kaos-Keraunos-Kybernetos---------------------------
 + ^ + :Surveillance cameras|Passwords are like underwear. You don't /|\
  \|/  :aren't security.  A |share them, you don't hang them on your/\|/\
<--*-->:camera won't stop a |monitor, or under your keyboard, you   \/|\/
  /|\  :masked killer, but  |don't email them, or put them on a web  \|/
 + v + :will violate privacy|site, and you must change them very often.
--------_sunder_ at _sunder_._net_------- http://www.sunder.net ------------
_______________________________________________
Sparcbook mailing list  -  Sparcbook at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sparcbook






More information about the SPARCBook mailing list