That's the right result! And now when you change directory, the prompt will change.
PS1 is described in the man page, in this case from KSH:
Setting PS1 in this way is only temporary. Set (or modify) it in your $HOME/.profile to make it permanent, so it's there each time you log in.
There's not much to my prompt, or .profile, but I set in there:
Depending on your system, the default PS1 could be defined somewhere in /etc: /etc/profile, /etc/environment, /etc/bashrc, etc.
I am having a hard time figuring out how to change the command prompt in my UNIX shell.
I am using the bash shell, and I would like to set the prompt to show me the full path of the current working directory along with my username, I suppose... The main thing I want is the full path of the... (2 Replies)
Me again,
What is the difficulty to display the full directory Path before my prompt command ? (like DOS)
I'm using Solaris 8 + Bash
Thanks again
Fabien (4 Replies)
Phew simple question,
I want to display the my directory path in prompt.
Did the following in .profile
PS1=`pwd`
export PS!
Worked, but it always points to HOME directory.
When i do a cd, it doesn't change.
What am i missing.
Thanks (7 Replies)
I know no one has ever asked this before {not :D } but I am trying to set the prompt in the .profile under sh. I have tried everything I have seen on the web in regards to this, with no success. The OS is SCO Unixware 7.1.1, {not by my choice}. All the examples I see seem to be for ksh, which is... (1 Reply)
I currently have this as my prompt when I log in (shell is sh):
PS1="`hostname ` # "
My question is how do I add the current directory to that prompt? Is there a way?
Thanks. (5 Replies)
hi all, please tell me why this 2 liner script is not working!!
#!/bin/bash
oldps1="$PS1"
PS1="myprompt>"
but when type this in terminal it works!! (7 Replies)
Is there any way I can change the prompt which asks for the password on a UNIX system? e.g. When I login using Telnet instead of "Password" I should get "Correct Password".
Thanks,
Vineet (3 Replies)
Currently, when I cd to a directory I get the directory path in the command prompt, making it very long. I would like to change it so the path is not displayed.
If I am in directory ~/tatsh/hstmy/test, I just want my prompt to be the last directory name as shown just below
---------- Post... (1 Reply)
Hi, i was wondering if it is possible to change the default prompt for the shells that are availble on your system?
For example, i want to change the prompt for the C shell from % to something like ( or ).
Thanks,
Nav. (7 Replies)
Need assistance in changing prompt .
Trying to change prompt in csh,tcsh shell . Below are the commands i tried in .cshrc and sourcing this files.
set prompt = "$user@`uname -n` : ${cwd}> "
#above commands works for username and hostname but cwd doesnt change
directories
set... (16 Replies)
Discussion started by: ajayram_arya
16 Replies
LEARN ABOUT OPENDARWIN
su
SU(1) BSD General Commands Manual SU(1)NAME
su -- substitute user identity
SYNOPSIS
su [-flm] [login] [-c shell arguments]
DESCRIPTION
su requests the password for login and switches to that user and group ID after obtaining proper authentication. A shell is then executed,
and any additional shell arguments after the login name are passed to the shell. If su is executed by root, no password is requested and a
shell with the appropriate user ID is executed.
The options are as follows:
-c Invoke the following command in a subshell as the specified user.
-f If the invoked shell is csh(1), this option prevents it from reading the ``.cshrc'' file.
-l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as
above. USER is set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The
invoked shell is the target login's, and su will change directory to the target login's home directory. This option is identical to
just passing "-", as in "su -".
-m Leave the environment unmodified. The invoked shell is your login shell, and no directory changes are made. As a security precau-
tion, if the target user's shell is a non-standard shell (as defined by getusershell(3)) and the caller's real uid is non-zero, su
will fail.
The -l and -m options are mutually exclusive; the last one specified overrides any previous ones.
Only users in group ``wheel'' (normally gid 0) or group ``admin'' (normally gid 20) can su to ``root''.
By default (unless the prompt is reset by a startup file) the super-user prompt is set to ``#'' to remind one of its awesome power.
SEE ALSO csh(1), login(1), sh(1), skey(1), kinit(1), kerberos(1), passwd(5), group(5), environ(7)ENVIRONMENT
Environment variables used by su :
HOME Default home directory of real user ID unless modified as specified above.
PATH Default search path of real user ID unless modified as specified above.
TERM Provides terminal type which may be retained for the substituted user ID.
USER The user ID is always the effective ID (the target user ID) after an su unless the user ID is 0 (root).
HISTORY
A su command appeared in Version 7 AT&T UNIX.
BSD April 18, 1994 BSD