Re: Strange behavior with PS1 prompt

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

 



On 18Oct2009 00:44, Petrus de Calguarium <kwhiskerz@xxxxxxxxx> wrote:
| Todd wrote:
| > The \[ and \] begin and end a series of non-printable
| > characters. This tells bash not to count those
| > characters when determining the length of the
| > prompt. So the color escape sequences are wrapped
| > in \[ and \].
| By Jove, you are right! No wonder I have seen the 
| problem on and off over the years! I just tested this 
| solution and it appears to work!
| 
| Cameron Simpson wrote:
| > This is all beautiful, but I think you need to use 
| > single quotes instead of doubles.
| So far, it appears that double quotes work.

\x inside double quotes remains ok if "x" isn't a special character,
but ${PWD} will definitely be expanded at assignment time instead of
"display the prompt" time. Try the double quoted thing and then cd
somewhere else and see how it behaves to check this.

Generally, since inside double quotes \\ means just \, and \$ means $
and so forth, you should _always_ use single quotes unless you want
sloshing and parameter substituion to be interpreted. Safer, more
reliable.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

... and I say to them,
   `Where the hell were you
    when the page was blank?'
                Harlan Ellison

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux