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, 10 Oct 1999 04: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. accounting for threads

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

4. Zip drive (Parallel)

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

6. Want to run CDE 1.0.2 on my PC XTerm software

7. Setting PS1 to emulate DOS type prompt

8. compaq deskpro 6000 ( 200mhz ppro ) dies at boot

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