Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Some (small) problems



Robert Elz wrote:

3. I lost my .shrc, and now I can't get my PS1 to work. I think I used
to use this:
--
PS1='[$( pwd | sed "s,^$HOME,~," )]; '    # which is [~]; when at home
--
but now it doesn't work.

It should, there is nothing in the processing of that which cares about
whether sh is dynamically linked or not.

However, because you have a command substitution in there, you also
need
	set -o promptcmds
or sh will refuse to execute it (since PS1 can be imported from the
environ).

I should've expanded on "doesn't work".

promptcmds is set. If PS1 from above is used, the prompt becomes the following:
--
[$( pwd | sed "s,^$HOME,~," )];
--

When entering a command:
--
[$( pwd | sed "s,^$HOME,~," )]; cat file.txt
[$( pwd | sed "s,^$HOME,~," )];     # no output is displayed
[`contents of file.txt`]; # command output goes inside when I press ^D
--

I need to press ^D multiple times to exit the shell until all output from
entered commands is gone through the prompt.

Other than some aliases and variables my /etc/profile, /etc/shrc, .profile and
.shrc don't contain anything.

The same configuration* works for mksh though.

* you need to comment out `set -o promptcmds` since mksh doesn't have it

--
caóc



Home | Main Index | Thread Index | Old Index