How to translate Linux's PS1 prompt to Unix's PS1 prompt?

How to translate Linux's PS1 prompt to Unix's PS1 prompt?

Post by Huy V » Sun, 31 Dec 1899 09:00:00



Hi all,

I tried to write a script  that can display the prompt as Linux does for
example:


#
or

$

Here is my script (It works on ksh of UnixWare 7)

UID=`id -u`
if [ $UID -eq 0 ]; then

# '
else

$ '
fi

but It will not display properly after running the command 'priv' to become
another users.

I wonder if I can do a script that can display the prompt as Linux prompt on
almost Unix system in Bourne Shell or Korn Shell without to install Bash.

 Thanks in advance for any advise.

H.V

 
 
 

1. How to translate Linux's PS1 prompt to Unix's PS1 prompt?

Hi all,

I tried to write a script  that can display the prompt as Linux does for
example:


#
or

$

Here is my script (It works on ksh of UnixWare 7)

UID=`id -u`
if [ $UID -eq 0 ]; then

# '
else

$ '
fi

but It will not display properly after running the command 'priv' to become
another users.

I wonder if I can do a script that can display the prompt as Linux prompt on
almost Unix system in Bourne Shell or Korn Shell without to install Bash.

 Thanks in advance for any advise.

H.V

2. Strange Mandrake 8.1 and gcc 2.96

3. PS1='[$PWD]'; how can I reduce the length of PS1 when it is long?

4. Multibooting 5 OSs => Win98, NT4, Linux, Solaris 8 and Unixware 7 - HOW TO???

5. ksh... PS1=$$ PS1="$$" PS1='$$'... aargh...

6. lilo installer and the # of cyls (shoot me and make it quick)

7. Setting PS1 to emulate DOS type prompt

8. Help: Need to reduce gain of MS wheel mouse

9. PS1 prompt customization

10. Displaying time in PS1 prompt (ksh on HPUX 9.01 or 10.0)

11. PS1 prompt

12. Screen Saver for IBM RT system/Setting the PS1 to display prompt?

13. Using `setterm -foreground` in BASH PS1 prompt