[Top][All Lists]

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

default PS1 is not POSIX-compliant?

From: Eric Blake
Subject: default PS1 is not POSIX-compliant?
Date: Fri, 3 Mar 2017 09:31:16 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

Chet, can you weigh in on http://austingroupbugs.net/view.php?id=1038 ?
There is a question of whether bash's choice of setting PS1='\s-\v\$ '
is correct in --posix mode, or whether it should be merely PS1='\$ '
when started in sh mode.  Allowing more than just the dollar (or hash
for root) and space would require a tweak to the POSIX wording.

Personally, I _like_ the longer prompt (it quickly lets me know whether
I'm using bash or some other shell), and you can always set PS1 to
whatever you want if the shell-startup default wasn't appropriate, but
if it is easier to patch 'bash --posix' to use a shorter prompt than it
is to fix the POSIX wording, then that may be the course to take.

Also, the bash behavior of modifying PS4 during subshells does not match
what other shells do.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]