Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Solaris SXDE 01/08 on amd64
Is it safe to use bash as the root shell? And if not, is is possible to change the prompt of the sh shell to something more usable? For instance, I'd like to have a 2-line prompt that looks like this:
root@servername
/somedir/anotherdir# _
And I'd like the word root to be in red so I am reminded to be careful and hurry up and log out.
This is the bash equivalent to PS1="\u\h\n\w# " without all the ascii color codes.
How do I know what directories to add to my path? I downloaded gcc from sunfreeware.com and got it installed (I think) w/pkgadd -d, but it's not in the path or maybe the libraries aren't? I wanted to install Midnight Commander, also from the same source, but it doesn't want to work for some reason. I did download and install all the listed dependencies, but there must be something else to this. Should I have installed by clicking an icon instead of the command line pkgadd -d? Thanks,
Terry
Last edited by tschima; 05-01-2008 at 09:59 PM.
Reason: Forgot to mention the specific OS
Of course you can use bash, if you're familiar with it
Quote:
How do I know what directories to add to my path? I downloaded gcc from sunfreeware.com and got it installed (I think) w/pkgadd -d, but it's not in the path or maybe the libraries aren't?
I don't know about Solaris SXDE, but Solaris 10 comes with gcc installed in /usr/sfw/bin (not in the default PATH anyway). The freeware gcc and other utils are installed under /usr/local/bin, so you have to add this directory in your PATH, in order to be able to use them.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
For question 1, it isn't recommended to change root's shell if you are mounting /usr on a different file system. Otherwise, there is no problem outside the fact login in as root is a poor practice, but you already know that.
About question 2, here is a shell script that will show you a populated PATH and MANPATH for Solaris. It looks into all standard and less standard places. The PATH can probably be cleaned up to remove unwanted directories or reorder some others as the same command may appear at different location.
Code:
#!/bin/ksh
for p in PATH MANPATH
do
case $p in
(PATH)
_PATH=""
for i in /usr/ucb $HOME/bin /opt/*/bin /usr/*/*/bin /sbin /usr/sbin /usr/*/bin /sbin /usr/bin ; do
if [ -d $i ]; then
for cmd in $i/*; do
if [ -x $cmd ]; then
eval _PATH=$i:$_PATH
break
fi
done
fi
done
;;
(MANPATH)
_MANPATH=""
for i in /opt/*/man /opt/*/share/man /usr/local/man /usr/local/*/man /usr/*/share/man /usr/*/man ; do
if [ -d $i ]; then
eval _MANPATH=$i:$_MANPATH
fi
done
;;
esac
eval printf "%s=%s\\\n" $p \$_$p
done
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.