Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
User Commands (s) su(1)
,password[,] Specifies the password for the new login name. The initial comma cannot have
any spaces before it. When this option is used, login dialog is bypassed unless
the value entered is incorrect for the login name specified. Passwords that con-
tain characters that have special meaning to the shell must be enclosed in quotes
if the password is specified on the command line. For information about shell
metacharacters, see "Quoting" in the sh(1) reference page.
If the comma is specified after the value, the dialog for changing the password of
the new login name must be completed.
To remind super ID users of their responsibilities, the shell substitutes a # (number sign) for its
usual prompt.
Environment Variables
This command supports the following environment variables: ENV, HOME, and LOGNAME.
EXAMPLES
1. The following command starts a new login shell for the login name myalias, runs the
/etc/profile and .profile files, and changes the user to the initial working directory of
myalias:
su - myalias
2. The following command does not start a new shell for the user named SUPER.SUPER
but does begin the editing of the system-wide profile file:
su SUPER.SUPER -c "vi /etc/profile"
3. The following command changes the password for the login name myalias in the current
shell:
su myalias
Password: oldpw,
Enter new password: newpw
Reenter new password: newpw
The password values oldpw and newpw are not echoed during this dialog.
4. The following command also changes the password for the login name myalias in the
current shell:
su myalias,oldpw,
Enter new password: newpw
Reenter new password: newpw
The new password value newpw is not echoed during this dialog.
RELATED INFORMATION
Commands: sh(1).
STANDARDS CONFORMANCE
This command is an extension to the XPG4 Version 2 specification.
527188-021 Hewlett-Packard Company 8−69