setting PS1 variable


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers setting PS1 variable
# 1  
Old 05-23-2005
setting PS1 variable

Hi,
I am trying to set my current prompt with the current directory iam working on by $PS1=$PWD but it is blank.
please help.
# 2  
Old 05-23-2005
Quote:
Originally Posted by papachi
Hi,
I am trying to set my current prompt with the current directory iam working on by $PS1=$PWD but it is blank.
please help.
what shell?

export PS1="\$PWD "
# 3  
Old 05-23-2005
shel l is bourne. With ur command it is giving me error "PS1=$PWD is not an identifier"
# 4  
Old 05-23-2005
Quote:
Originally Posted by papachi
shel l is bourne. With ur command it is giving me error "PS1=$PWD is not an identifier"
cannot be done [dynamically] easily with Bourne - at least not from the top of my head and not .

Maybe others will have ideas - I don't use Bourne these days anymore.

the posting was for ksh/bash.

Last edited by vgersh99; 05-23-2005 at 04:09 PM..
# 5  
Old 05-23-2005
See the last entry in this thread
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need to revert default prompt in Linux after setting PS1 command

I have given as: PS1="Karthick>" in linux. Now the prompt changed as: Karthick> Now I need to get back the default prompt . How to achieve this? Thanks in advance (13 Replies)
Discussion started by: karthick nath
13 Replies

2. UNIX for Dummies Questions & Answers

setting the PS1 variable

Hi i'm new to unix, can anyone assist in me setting the PS1 variable in unix (3 Replies)
Discussion started by: user@123
3 Replies

3. UNIX for Dummies Questions & Answers

Setting PS1

I have set PSI for my prompt using the following command: PS1="${debian_chroot:+($debian_chroot)}\\u@\h:\\\w\a]\ "which produces chrisd@pguk:~]I want to include [ in the beginning but cannot understand the way to do this. Also I want to show only the current directory, not the whole... (4 Replies)
Discussion started by: kristinu
4 Replies

4. Shell Programming and Scripting

Please explain below PS1 variable

please tell me what is "!" mean in below value of PS1 variable PS1='($PWD) !>' Thanks Sunny (3 Replies)
Discussion started by: sunilmenhdiratt
3 Replies

5. Solaris

problem in setting PS1 variable

Hi I have set PS1 in my profile as - PS1='${LOGNAME}@${PWD}>' ; export PS1 it works fine if I am in bash/ksh shell, but as soon as i switch to bourn shell (sh) then it shows "${LOGNAME}@${PWD}>" as prompt. It is also not working in csh. Please help. (3 Replies)
Discussion started by: sanjay1979
3 Replies

6. Shell Programming and Scripting

Help setting PS1 prompt to include current time

Hi, I'm using the ksh shell and I'd like to set my PS1 prompt on an AIX system to include, amongst ther things, the current time. This was my best effort: export PS1=$(date -u +%R)'${ME}:${PWD}# ' but this only sets the time to the value when PS1 is defined and the time value doesn't... (4 Replies)
Discussion started by: m223464
4 Replies

7. Shell Programming and Scripting

.bashrc files modifying the PS1 variable?

Is there a command for finding all files on the system named ".bashrc" that modify the PS1 variable? I'd like to list the full file name(s) and the protection (including the full path). (5 Replies)
Discussion started by: raidkridley
5 Replies

8. UNIX for Dummies Questions & Answers

Finding files that midify the PS1 variable.

Any help developing a command to find all files on the system named ".bashrc" that modify the PS1 variable. I wanna list the full file name, including the full path, and protection. Nothing else. (2 Replies)
Discussion started by: raidkridley
2 Replies

9. UNIX for Advanced & Expert Users

PS1 variable

I want to set my prompt to something more descriptive than a plain old $, so I set the PS1 variable as such: PS1="" Which changes the prompt correctly, but when I change directories, it does not update the prompt. So I tried this: PS1="`pwd`>" I get the same results when changing... (2 Replies)
Discussion started by: dangral
2 Replies

10. UNIX for Dummies Questions & Answers

Very simple question about changing PS1 variable at startup!

Hello there ! I am new in this Unix world and just start learning Unix. I have very simple question about changing PS1 variable (Shell Prompt) i have local.profile file in my working directory, i open in vi edit mode and add this line PS1="Hello:>" and i save that file. I disconnected from... (2 Replies)
Discussion started by: abidmalik
2 Replies
Login or Register to Ask a Question