[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Expand a prompt string to calculate its length?
From: |
Jesse Hathaway |
Subject: |
[Help-bash] Expand a prompt string to calculate its length? |
Date: |
Wed, 19 Jun 2019 13:09:33 -0500 |
Is there anyway to expand a partial prompt string to calculate its length?
For instance expand:
PS1='\h:\w$ '
# to
PS1='bubbles:~/tmp$'
For the purpose of determining its length, before displaying the prompt?
I would like to add a horizontal line to the first line of my PS1, but I need
to know the length of the PS1 prefix, in order to calculate the width of the
line.
Something like this:
|bubbles:~/tmp-----------------------------------------|
|$ |
- [Help-bash] Expand a prompt string to calculate its length?,
Jesse Hathaway <=
- Re: [Help-bash] Expand a prompt string to calculate its length?, Greg Wooledge, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Andy Chu, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Greg Wooledge, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Jesse Hathaway, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Greg Wooledge, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Andy Chu, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Greg Wooledge, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Andy Chu, 2019/06/19
- Re: [Help-bash] Expand a prompt string to calculate its length?, Jesse Hathaway, 2019/06/21