Friday, September 14, 2007

Create PS1 in Solaris 8

Sometime when you are already like shell environment like BASH (Bourne Again SHell), you will have problem on some old shell like csh, ksh, or even sh. In this section I will show you how to create a user and their user environment using BASH. I will use Solaris 8 as example since Solaris 8 doesnt give you BASH as your default environment.

As root , create a normal user with this command, here I will use Jackie as example

useradd -d /export/home/jackie -m -s /usr/bin/bash -c "Jackie" jackie passwd jackie

then on the /export/home/jackie/.profile add this 2 lines:

PS1="[\u@h \w]\$"
export PS1

save it. Then let the user log in using their jackie and his new password.

He will see the environment like this:
[jackie@myserver jackie]$

try to logout and login again if the result is not like expected.

No comments: