Path in prompt line?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Path in prompt line?
# 1  
Old 04-02-2007
Path in prompt line?

Can anyone tell me what makes the current path appear in the prompt ?

thx
# 2  
Old 04-02-2007
This works for me on sh

Code:
export PS1="[\w] "

# 3  
Old 04-02-2007
no, doesnt work for me ...

I get something like this:

migserv2:/appl/users/migesr> bash
bash-2.05b$
# 4  
Old 04-02-2007
it works !!!

you need to export the PS1 variable in the new shell

else export the PS1 variable in to the bash profile Smilie
# 5  
Old 04-02-2007
For Bash Shell:

Code:
PS1='\u@\h:\w\$ '

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect prompt extending to next line

Hi guys, I am trying to install a software which is a shell script. I am using expect to do the silent installation. There is a strange line during the installation of the software like this below. The prompt goes to the next line. ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE... (0 Replies)
Discussion started by: kapkap
0 Replies

2. Shell Programming and Scripting

Pattern match a path anywhere in the line and replace it with new path

I want to pattern match only path part from below and replace them with new path string. LoadModule jk_module /fldrA/fldrBaf/fldrCaa/modules/mod_jk.so JkWorkersFile /fldrA/fldrBaf/fldrCaa/config/OHS/ohs1/workers.properties JkLogFile... (4 Replies)
Discussion started by: kchinnam
4 Replies

3. UNIX for Dummies Questions & Answers

Prompt path display issue

I use the following command to print the current directory above the command prompt set prompt="`exec pwd`\n$USER@`hostname -s` %B: % > " The output is something like this <current path> $USER@hostname > But when I try to CD to any other directory and press the return key, the... (6 Replies)
Discussion started by: aelhosiny
6 Replies

4. Shell Programming and Scripting

Two-line prompt using Korn

I'm attempting to set up a two-line prompt using Korn. This is what I've set up in .kshrc PS1='$(print -n "`logname`@`hostname`:";if ] then; print -n "~${PWD#$HOME}"; else; print -n "$PWD";fi;print "\n$ ")' And in .profile, ENV="$HOME/.kshrc"; export ENV The hosts that in use are... (10 Replies)
Discussion started by: capnpepper
10 Replies

5. Shell Programming and Scripting

Is it possible to prompt for input if not given on command line?

I have a script built that takes the standard inputs $1 $2 $3 after the name and parses some data. hexsite=`echo "obase=16;$1"|bc` hexfix=$(printf "%.3X" 0x$hexsite) if || ;then type=33 elif || ;then type=59 elif ;then type=99 else type=00 fi cat /directory/*.2012$3*| I am... (8 Replies)
Discussion started by: PCGameGuy
8 Replies

6. UNIX Desktop Questions & Answers

Website-Command Line Prompt

Hello guys... I am having a doubt. Please try to rectify it. I would really appreciate it. The thing is that is it possible to open any website say for example,google from the command line prompt(terminal) if you are working in Linux-fedora... I am very new to Unix. regards, Mahesh... (2 Replies)
Discussion started by: mraghunandanan
2 Replies

7. 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

8. 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

9. AIX

prompt line

Hlo sir My system file / system file is full and i am unable to enter any command such as ls or to start my server RS6000 The network is blocked and the users are log off. (0 Replies)
Discussion started by: sobnc
0 Replies

10. UNIX for Dummies Questions & Answers

2 line prompt

I know this is very easy. I just am having a problem determining how to do it. I want to have a 2-line command prompt when you hit return. I have no problem creating or exporting a PS1, but can't make into 2 lines. hostname-user:/path/to/dir # I really should know this, but my brain... (7 Replies)
Discussion started by: Kelam_Magnus
7 Replies
Login or Register to Ask a Question