Edit your .bashrc
output:
How to customize PS1 prompt in KSH?
eg:
>[/current/dir] >
>
>I'd like it to be:
>[/current/dir]
edit your .profile
export PS1=[`hostname`:'$PWD]^V^J
>'
where ^V is control-V and ^J is control-J to accomplish this.
Posted in Unix by Alex Yap | 0 comments
Email this postHow to replace ^M in unix to nothing?
Monday, May 3, 2010
If you saw a lot of ^M character in your code, reason being is ^M is the character in DOS if you create the file in Windows.
If you transfer the DOS file into unix, you will see lots of ^M in your file and it is very irritating indeed.
You can do a simple magic in vi by
:%s/[crtl-v ctrl-m//g
meaning,
%s - substitute
[ctrl-v ctrl-m] - create the ^M character
// - empty
g - replace globally
Posted in Unix, vi by Alex Yap | 0 comments
Email this post
Subscribe to:
Posts (Atom)