On Mon, Apr 18, 2016 at 11:38 AM, Dyck, Lionel B. (TRA) <[email protected]>
wrote:
> Does anyone have an example of a .profile in which the prompt is changed
> so that it is different when in normal user state and in superuser state?
>
I haven't done the following. I don't use /bin/sh as my z/OS UNIX command
shell (I use BASH). But the documentation says that ~/.profile is sourced
when a _login_ shell is requested. It also says that if the ENV environment
variable is set, that file is sourced even for a non-login shell. So you
could create a shell script similar to:
=== ~/.setprompt ===
test $(id -u) -eq 0 && {
egrep '#$' || export PS1="${PS1}#"; }
===
And in your ~/.profile include the line:
export ENV="~/.setprompt"
The ~/.setprompt will append a hash tag (UNIX standard) to the end of the
PS1 (shell prompt) environment variable unless PS1 already ends in a #.
Should work.
>
> Thanks in advance
>
>
--
"He must have a Teflon brain -- nothing sticks to it"
Phyllis Diller
Maranatha! <><
John McKown
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN