bmclellan
asked on
Changing Unix Prompt
I was looking through a Unix book and it gave a sample for changing the unix command prompt:
PS1='$PWD ^J\$ '
This should get a prompt like
/home/user
$
unfortunately I get the prompt
/home/user ^J$
Can anyone tell me how to get this prompt on two lines!
Thanks
PS1='$PWD ^J\$ '
This should get a prompt like
/home/user
$
unfortunately I get the prompt
/home/user ^J$
Can anyone tell me how to get this prompt on two lines!
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, since I got the comment from two people, I will assume that my shell is not taking the \ as an escape. The solution above resulted in the 'n' being printed, and no second line.
Thanks anyways
Barry
Thanks anyways
Barry
What you neglected to explain that when you see "^J" or "^" followed by anything, this means that you should replace that character with the escape code for that character.
In most VT emulators, just type CTRL-V followed by CTRL-J instead of the "^J" sequence in the original command.
-- Bubba
PS1='$PWD \n\$ '
Hope this helps