Sponsored Content
Full Discussion: Prompt path display issue
Top Forums UNIX for Dummies Questions & Answers Prompt path display issue Post 302921664 by aelhosiny on Sunday 19th of October 2014 07:52:31 AM
Old 10-19-2014
Sorry,
I did not mention that I'm using csh as default shell on centos 5.10
It's the default shell set by the sys admin

Accordingly the PS1 does not exist Smilie
I have already added these commands to my .cshrc

---------- Post updated at 01:52 PM ---------- Previous update was at 01:42 PM ----------

Quote:
Originally Posted by RavinderSingh13
Hello aelhosiny,

Not sure completely about your requirement, but if you want to change prompt string then you can use PS1 command as follows.

Code:
[singh@localhost awk_programming]$ 
[singh@localhost awk_programming]$ PS1="TEST $"
TEST $man test

Similarly you can put any pwd according to your need in it. Also if you want to permanently fix prompt string you can add this command in the .profile of user.

Thanks,
R. Singh

What I need the command prompt to display the full path and $USER@HOST each in a separate line instead of both displayed in the same line so that I will have:

Code:
<The exact long path>
<my username> @ <hotsname> $

As you see, the path is not in the same line with the username and host.

Last edited by rbatte1; 10-20-2014 at 09:53 AM.. Reason: Changed ICODE tags to just CODE tags
 

10 More Discussions You Might Find Interesting

1. Solaris

no boot prompt display

just put blank harddisk in my ultra10. i see no display to show me the boot> prompt. i don't know what happened....?? Got a third party graphic card. Display was ok. Monitor seems to be ok. i used different one with same result. (1 Reply)
Discussion started by: S26+
1 Replies

2. UNIX for Dummies Questions & Answers

Path in prompt line?

Can anyone tell me what makes the current path appear in the prompt ? thx (4 Replies)
Discussion started by: Leitwolf
4 Replies

3. Solaris

Solaris 10 install doesn't display Network Connectivity prompt page

I have two Dell x86 machines on which I am attempting to install Solaris 10 from CD. I am not doing a Jumpstart install. This is my first experience in installing Solaris (or any other OS). I am following the instructions at How to Quickly Install the Solaris 10 1/06 OS The first machine... (3 Replies)
Discussion started by: sarahsi
3 Replies

4. Solaris

How to display hostname in command prompt

Anyone know How to configure solaris 8 to display hostname in command prompt , everytime when you open a terminal screen . (3 Replies)
Discussion started by: civic2005
3 Replies

5. Shell Programming and Scripting

How to change prompt color when changing path

Hi all, Can you tell me how to change the prompt color (only the path part) when I chnange directory with "cd"? I use the sequence below in ".bashrc" (Solaris 8) to change my prompt colors and I'd like to modify it to change the path color when I cange directory. PSC() { echo -ne "\"; }... (0 Replies)
Discussion started by: majormark
0 Replies

6. UNIX for Advanced & Expert Users

Help-prompt for path and take this as input in find command

HI , I am trying to wite a script that will prompt me saying " what is path that you want to find ?". once i specify the path, the script should put this path in the find command mentioned below and execute the script: find <path> -ctime +200 -type f -exec ls -l {} \; for example : ... (7 Replies)
Discussion started by: bsandeep_80
7 Replies

7. Shell Programming and Scripting

how to change unix cmd display prompt?

I am new to to unix and I want to make my own basic shell. What is the code I can use to change the unix cmd console display? For example my unix display prompt says MyCompterName~, I want it to say WhatEverMan~ (3 Replies)
Discussion started by: megaearth77
3 Replies

8. Shell Programming and Scripting

How to display current time in the prompt

Hello All, I would like to display the current time in prompt. I tried using following command: export PS1="$(date +%k:%M:%S) $ " but it gave me a fixed time in prompt whereas my objective is to get the current time everytime. $ export PS1="$(date +%k:%M:%S) $ " 17:42:42 $ 17:42:42 $... (32 Replies)
Discussion started by: manishdivs
32 Replies

9. UNIX for Dummies Questions & Answers

Display the absolute path...

I don't understand the question below..any can help me? thanks Display the absolute path of the executable used when a 'grep' command is entered on the command line: ---------- Post updated at 08:30 PM ---------- Previous update was at 08:29 PM ---------- absolute (2 Replies)
Discussion started by: wk9031
2 Replies

10. Shell Programming and Scripting

Bash function to suppress warning message for specific text and display prompt

In the below bash function multiple variants are input and stored in a variable $variant, and each is written to an out file at c:/Users/cmccabe/Desktop/Python27/out.txt stored on a separate line. # enter variant phox2b() { printf "\n\n" printf "What is the id of the patient getting... (0 Replies)
Discussion started by: cmccabe
0 Replies
SU(1)							    BSD General Commands Manual 						     SU(1)

NAME
su -- substitute user identity SYNOPSIS
su [-] [-c class] [-flms] [login [args]] DESCRIPTION
The su utility requests appropriate user credentials via PAM and switches to that user ID (the default user is the superuser). A shell is then executed. PAM is used to set the policy su(1) will use. In particular, by default only users in the ``wheel'' group can switch to UID 0 (``root''). This group requirement may be changed by modifying the ``pam_group'' section of /etc/pam.d/su. See pam_group(8) for details on how to modify this setting. By default, the environment is unmodified with the exception of USER, HOME, and SHELL. HOME and SHELL are set to the target login's default values. USER is set to the target login, unless the target login has a user ID of 0, in which case it is unmodified. The invoked shell is the one belonging to the target login. This is the traditional behavior of su. Resource limits and session priority applicable to the orig- inal user's login class (see login.conf(5)) are also normally retained unless the target login has a user ID of 0. The options are as follows: -c class Use the settings of the specified login class. The login class must be defined in login.conf(5). Only allowed for the super-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. Envi- ronment variables may be set or overridden from the login class capabilities database according to the class of the target login. The invoked shell is the target login's, and su will change directory to the target login's home directory. Resource limits and ses- sion priority are modified to that for the target account's login class. - (no letter) The same as -l. -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. -s Set the MAC label to the user's default label as part of the user credential setup. Setting the MAC label may fail if the MAC label of the invoking process is not sufficient to transition to the user's default MAC label. If the label cannot be set, su will fail. The -l (or -) and -m options are mutually exclusive; the last one specified overrides any previous ones. If the optional args are provided on the command line, they are passed to the login shell of the target login. Note that all command line arguments before the target login name are processed by su itself, everything after the target login name gets passed to the login shell. 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. 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). FILES
/etc/pam.d/su PAM configuration for su. EXAMPLES
su -m man -c catman Starts a shell as user man, and runs the command catman. You will be asked for man's password unless your real UID is 0. Note that the -m option is required since user ``man'' does not have a valid shell by default. In this example, -c is passed to the shell of the user ``man'', and is not interpreted as an argument to su. su -m man -c 'catman /usr/share/man /usr/local/man' Same as above, but the target command consists of more than a single word and hence is quoted for use with the -c option being passed to the shell. (Most shells expect the argument to -c to be a single word). su -m -c staff man -c 'catman /usr/share/man /usr/local/man' Same as above, but the target command is run with the resource limits of the login class ``staff''. Note: in this example, the first -c option applies to su while the second is an argument to the shell being invoked. su -l foo Simulate a login for user foo. su - foo Same as above. su - Simulate a login for root. SEE ALSO
csh(1), sh(1), group(5), login.conf(5), passwd(5), environ(7), pam_group(8) HISTORY
A su command appeared in Version 1 AT&T UNIX. BSD
August 11, 2013 BSD
All times are GMT -4. The time now is 03:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy